PRG 420 Entire Course Solutions Download University of Phoenix
PRG420 Entire Course includes:
PRG 420 Week 1 Individual Assignment
PRG 420 Week 2 Individual Assignment
PRG 420 Week 3 Individual Assignment
PRG 420 Week 4 Individual Assignment
PRG 420 Week 5 Individual Assignment
PRG 420 Week 5 Individual Assignment Exception Handling
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program. The Java™ program you write should do the following: Organize the code capable of throwing an exception of type ParseException as a try block. Include a catch block to handle a ParseException error thown by the try block. Include a hard-coded error that results in a ParseException to prove that the code can catch and handle this type of exception. Complete this assignment by doing the following: Download and unzip the linked Week Five Coding Assigment Zip File. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 Replace the value assigned with one of the variables so that the program throws an exception. Comment each line of code you add to explain what you intend the code to do. Be sure to include a comment for the replacement value you added in Step 4 that causes the program to throw an exception. Test and modify your Java™ program until it runs without errors and produces
the results described above. Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java application file using the Assignment Files tab. PRG 420 Week 5 Screenshot You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers
PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program that creates and accesses an array of integers. The Java™ program you write should do the following: Create an array to hold 10 integers Ask the user for an integer. Note: This code has already been written for you. Populate the array. Note: The first element should be the integer input by the user. The second through tenth elements should each be the previous element + 100. For example, if the user inputs 10, the first array value should be 10, the second 110, the third 210, and so on. • Display the contents of the array on the screen in ascending index order. Complete this assignment by doing the following: Download and unzip the linked Week Four Coding Assigment Zip File. Read each line of the file carefully, including the detailed instructions at the top. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 LINE 4 LINE 5 Comment each line of
code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above. Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab. PRG 420 Week 4 Screenshot You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 3 Individual Assignment For While and Do While Loops
For this assignment, you will apply what you learned in analyzing for, while, and do-while loops by writing these statements yourself. The Java™ program you write should do the following: Display a pyramid of asterisks onscreen (i.e., a nested for loop) Display the integers 10 to 1 in decreasing order, one number per line (i.e., a while/do-whlie loop) Add 7 until the sum becomes greater than 157, at which point the program should display both the sum and the number of 7s added Complete this assignment by doing the following: Download and unzip the linked Week Three Coding Assigment Zip File. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 Comment each line of code you add to explain what you intend the code to do and why you chose each type of loop. Test and modify your Java™ program until it runs without errors and produces the results as described above. Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment
Files tab. PRG 420 Week 3 Screenshot You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon
For this assignment, you will apply what you learned in analyzing Java™ code so far in this course by writing your own Java™ program. The Java™ program you write should do the following: Accept user input that represents the number of sides in a polygon. Note: The code to do this is already written for you. If input value is not between 3 and 5, display an informative error message If input value is between 3 and 5, use a switch statement to display a message that identifies the correct polygon based on the number of sides matching the input number (e.g., triangle, rectangle, or polygon) Complete this assignment by doing the following: Download tnd unzip ahe linked Week Two Coding Assigment Zip File. Read the file carefully, especially the explanatory comments of what the existing code does. Add your name and the date in the multi-line comment header. Refer to the following linked Week Two Recommended Activity Zip File to see examples of how to code all of the Java™ statements (i.e., switch, println(), and if-then-else) you will need to write to complete this assignment. Replace the following lines with Java code as directed in the file: • LINE
1 • LINE 2 Comment each line of code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above. Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab. PRG 420 Week 2 Individual Assignment You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 1 Individual Assignment Hello World
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program. The Java™ program you write should do the following: Display a prompt on the console asking the user to type in his or her first name Construct the greeting string “Hello, nameEntered!” Display the constructed greeting on the console Complete this assignment by doing the following: Download and unzip the linked zip file. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 LINE 4 Comment each line of code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above. Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab. PRG 420 Week 1 Individual Assignment You May Also Like: PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops
PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 1 Java 1.13 LAB Right-facing arrow
Given two input integers for an arrowhead and arrow body, print a right-facing arrow. Ex: If the input is: 0 1 the output is: 1 11 00000111 000001111 00000111 11 1 PRG 420 Java Lab 1.13 You May Also Like: PRG 420 Week 1 Java 1.29 LAB Expression for Calories Burned During Workout PRG 420 Week 1 Java 1.30 LAB Mad Lib PRG 420 Week 1 Java 1.31 LAB Phone number Breakdown
PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 For coding simplicity, follow every output value by a space, even the last one. Your program must define and call a method: public static int getMinimumInt(int[] listInts, int listSize) Note: This is a lab from a previous chapter that now requires the use of a method.
PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like Amazon, where a user can filter results. Write your code to define and use two methods: public static void getUserValues(int[] myArr, int arrSize, Scanner scnr) public static void outputIntsLessThanOrEqualToThreshold(int[] userValues, int userValsSize, int upperThreshold) Utilizing methods will help to make main() very clean and intuitive. Note: This is a lab from a previous chapter that now requires the use of methods. You May Also Like:
PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.21 LAB Contact List
A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Assume that the list will always contain less than 20 word pairs. Ex: If the input is: 3 Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 Your program must define and call the following method. The return value of getPhoneNumber() is the phone number associated with the specific contact name. public static String getPhoneNumber(String[] nameVec, String[] phoneNumberVec, String contactName, int arraySize) Hint: Use two arrays: One for the string names, and the other for the string phone numbers. You May Also Like: PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.19 LAB
Remove Spaces Methods PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.20 LAB Acronyms
An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don’t include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is Institute of Electrical and Electronics Engineers, the output should be: IEEE Your program must define and call a method thats returns the acronym created for the given userPhrase. public static String CreateAcronym(String userPhrase) Hint: Refer to the ascii table to make sure a letter is upper case. You May Also Like: PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods
Write a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. Your program must define and call the following method. The method should return a string representing the input string without spaces. public static String removeSpaces(String userString) Note: This is a lab from a previous chapter that now requires the use of a method. You May Also Like: PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.18 LAB Flip a Coin
Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: tails heads tails For reproducibility needed for auto-grading, seed the program with a value of 2. In a real program, you would seed with the current time. In that case, every program’s output would be different, which is what is desired but can’t be auto-graded. Note: A common student mistake is to create an instance of Random before each call to rand.nextInt(). But seeding should only be done once, at the start of the program, after which rand.nextInt() can be called any number of times. Your program must define and call the following method that returns “heads’ or ‘tails”. public static String headsOrTails(Random rand) You May Also Like: PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420
Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.17 LAB Max Agnitude
Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the method in a program that takes two integer inputs, and outputs the largest magnitude value. Ex: If the inputs are: 5 7 the method returns: 7 Ex: If the inputs are: -8 -2 the method returns: -8 Note: The method does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the absolute value built-in math method. Your program must define and call a method: public static int maxMagnitude(int userVal1, int userVal2) You May Also Like: PRG 420 Week 5 Java 5.16 LAB Step Counter PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 5 Java 5.16 LAB Step Counter
A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf(“%.2f”, yourValue); Ex: If the input is: 5345 the output is: 2.67 Your program must define and call a method: public static double stepsToMiles(int userSteps) You May Also Like: PRG 420 Week 5 Java 5.17 LAB Max Agnitude PRG 420 Week 5 Java 5.18 LAB Flip a Coin PRG 420 Week 5 Java 5.19 LAB Remove Spaces Methods PRG 420 Week 5 Java 5.20 LAB Acronyms PRG 420 Week 5 Java 5.21 LAB Contact List PRG 420 Week 5 Java 5.22 LAB Output Values Below an Amount Methods PRG 420 Week 5 Java 5.23 LAB Adjust List by Normalizing Methods
PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers. Ex: If the input is: 5 10 5 3 21 2 the output is: 2 3 To achieve the above, first read the integers into an array. Hint: Make sure to initialize the second smallest and smallest integers properly. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.14 LAB Contains the Character PRG 420 Week 4 Java 4.15 LAB Elements in a Range
PRG 420 Week 4 Java 4.15 LAB Elements in a Range
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a space, even the last one. The output ends with a newline. Ex: If the input is: 5 25 51 0 200 33 0 50 then the output is: 25 0 33 (the bounds are 0-50, so 51 and 200 are out of range and thus not output). To achieve the above, first read the list of integers into an array. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java
4.14 LAB Contains the Character PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.14 LAB Contains the Character
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Assume that the list of words will always contain fewer than 20 words. Ex: If the input is: 4 hello zoo sleep drizzle z then the output is: zoo drizzle To achieve the above, first read the list into an array. Keep in mind that the character ‘a’ is not equal to the character ‘A. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.13 LAB Word Frequencies
Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1 Hint: Use two arrays, one array for the strings and one array for the frequencies. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.14 LAB Contains the Character PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing
When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 The 5 indicates that there are five values in the list, namely 30, 50, 10, 70, and 65. 10 is the smallest value in the list, so is subtracted from each value in the list. For coding simplicity, follow every output value by a space, including the last one. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.14 LAB Contains the Character
PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like Amazon, where a user can filter results. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.14 LAB Contains
the Character PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.10 LAB Middle Item
Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd. Ex: If the input is: 2 3 4 8 11 -1 (where a negative indicates the end), the output is: 4 The maximum number of inputs for any test case should not exceed 9. If exceeded, output “Too many inputs”. Hint: First read the data into an array. Then, based on the array’s size, find the middle item. You May Also Like: PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.14 LAB Contains the Character PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 4 Java 4.9 LAB Output Numbers in Reverse
Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a space, including the last one. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 2 4 6 8 10 the output is: 10 8 6 4 2 To achieve the above, first read the integers into an array. Then output the array in reverse. You May Also Like: PRG 420 Week 4 Java 4.10 LAB Middle Item PRG 420 Week 4 Java 4.11 LAB Output Values Below an Amount PRG 420 Week 4 Java 4.12 LAB Adjust List by Normalizing PRG 420 Week 4 Java 4.13 LAB Word Frequencies PRG 420 Week 4 Java 4.14 LAB Contains the Character PRG 420 Week 4 Java 4.15 LAB Elements in a Range PRG 420 Week 4 Java 4.16 LAB Two Smallest Numbers
PRG 420 Week 3 Java 3.18 LAB Palindrome
A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: ‘bob,’ “sees,’ or “never odd or even’ (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome. Ex: If the input is: bob the output is: bob is a palindrome Ex: If the input is: bobby the output is: bobby is not a palindrome Hint: Start by just handling single-word input, and submit for grading. Once passing single-word test cases, extend the program to handle phrases. If the input is a phrase, remove or ignore spaces. You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse
PRG 420 Week 3 Java 3.17 LAB Print String in Reverse
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters ‘Quit’, “quit, or ‘q’ for the line of text. Ex: If the input is: Hello there Hey quit the output is: ereht olleH yeH You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10
Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can’t be less than the first. For coding simplicity, output a space after every integer, including the last. You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG420 Week 3 Java 3.15 LAB Count Input Length
Given a line of text as input, output the number of characters excluding spaces, periods, or commas. Ex: If the input is: Listen, Mr. Jones, calm down. the output is: 21 Note: Account for all characters that aren’t spaces, periods, or commas (Ex: “r”, “2”, “!”). You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 3 Java 3.14 LAB Remove Spaces
Write a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 3 Java 3.13 LAB Checker for Integer String
Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() function. You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 3 Java 3.12 LAB Varied amount of input data
Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 You can assume that at least one non-negative integer is input. You May Also Like: PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 3 Java 3.11 LAB Mad Lib Loops
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and integer as input, and outputs a sentence using those items as below. The program repeats until the input string is quit 0. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. Note: This is a lab from a previous chapter that now requires the use of a loop. You May Also Like: PRG 420 Week 3 Java 3.12 LAB Varied amount of input data PRG 420 Week 3 Java 3.13 LAB Checker for Integer String PRG 420 Week 3 Java 3.14 LAB Remove Spaces PRG420 Week 3 Java 3.15 LAB Count Input Length PRG 420 Week 3 Java 3.16 LAB Output Range with Increment of 10 PRG 420 Week 3 Java 3.17 LAB Print String in Reverse PRG 420 Week 3 Java 3.18 LAB Palindrome
PRG 420 Week 2 Java 2.24 LAB Name format
Many documents use a specific format for a person’s name. Write a program whose input is: firstName middleName lastName, and whose output is: lastName, firstName middlelnitial. Ex: If the input is: Pat Silly Doe the output is: Doe, Pat S. If the input has the form firstName lastName, the output is lastName, firstName. Ex: If the input is: Julia Clark the output is: Clark, Julia You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.21 LAB Seasons PRG 420 Week 2 Java 2.22 LAB Exact change PRG 420 Week 2 Java 2.23 LAB Leap Year
PRG 420 Week 2 Java 2.23 LAB Leap Year
A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 is a leap year. Ex: If the input is: 1913 the output is: 1913 is not a leap year. You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.21 LAB Seasons
PRG 420 Week 2 Java 2.22 LAB Exact change
Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes PRG 420 Lab 2.22 You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.21 LAB Seasons PRG 420 Week 2 Java 2.23 LAB Leap Year PRG 420 Week 2 Java 2.24 LAB Name format
PRG 420 Week 2 Java 2.21 LAB Seasons
Write a program that takes a date as input and outputs the date’s season. The input is a string to represent the month and an int to represent the day. Ex: If the input is: April 11 the output is: Spring In addition, check if the string and int are valid (an actual month and day). Ex: If the input is: Blue 65 the output is: Invalid The dates for each season are: Spring: March 20 – June 20 Summer: June 21- September 21 Autumn: September 22 – December 20 Winter: December 21 – March 19 PRG 420 Lab 2.21 Seasons You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.22 LAB Exact change PRG 420 Week 2 Java 2.23 LAB Leap Year PRG 420 Week 2 Java 2.24 LAB Name format
PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number.
See Wikipedia for more info on highway numbering.
PRG 420 Lab 2.20 Highway Number
You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.21 LAB Seasons PRG 420 Week 2 Java 2.22 LAB Exact change PRG 420 Week 2 Java 2.23 LAB Leap Year PRG 420 Week 2 Java 2.24 LAB Name format
PRG 420 Week 2 Java 2.19 LAB Smallest number
Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 PRG 420 Week 2 Lab 2.19 You May Also Like: PRG 420 Week 2 Java 2.18 LAB Warm up PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.21 LAB Seasons PRG 420 Week 2 Java 2.22 LAB Exact change PRG 420 Week 2 Java 2.23 LAB Leap Year PRG 420 Week 2 Java 2.24 LAB Name format
PRG 420 Week 2 Java 2.18 LAB Warm up
(1) If a user’s input string matches a known text message abbreviation, output the unabbreviated form, else output: Unknown. Support two abbreviations: LOL — laughing out loud, and IDK — I don’t know. (4 pts) Sample input/output: Input an abbreviation: LOL laughing out loud (2) Expand to also decode these abbreviations. (3 pts) BFF — best friends forever IMHO — in my humble opinion TMI — too much information PRG 420 Lab 2.18 You May Also Like: PRG 420 Week 2 Java 2.19 LAB Smallest number PRG 420 Week 2 Java 2.20 LAB Interstate Highway Numbers PRG 420 Week 2 Java 2.21 LAB Seasons PRG 420 Week 2 Java 2.22 LAB Exact change PRG 420 Week 2 Java 2.23 LAB Leap Year PRG 420 Week 2 Java 2.24 LAB Name format
PRG 420 Week 1 Java 1.31 LAB Phone number Breakdown
Given a long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212. Ex: If the input is: 8005551212 the output is: (800) 555-1212 Hint: Use % to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which is 72. Hint: Use / to shift right by the desired amount. Ex: Shifting 572 right by 2 digits is done by 572 / 100, which yields 5. (Recall integer division discards the fraction). For simplicity, assume any part starts with a non-zero digit. So 0119998888 is not allowed. PRG 420 Week 1 Lab 1.31 You May Also Like: PRG 420 Week 1 Java 1.13 LAB Right-facing arrow PRG 420 Week 1 Java 1.29 LAB Expression for Calories Burned During Workout PRG 420 Week 1 Java 1.30 LAB Mad Lib
PRG 420 Week 1 Java 1.30 LAB Mad Lib
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story. Ex: If the input is: Eric Chipotle 12 cars the output is: Eric went to Chipotle to buy 12 different types of cars. PRG 420 Lab 1.30 You May Also Like: PRG 420 Week 1 Java 1.13 LAB Right-facing arrow PRG 420 Week 1 Java 1.29 LAB Expression for Calories Burned During Workout PRG 420 Week 1 Java 1.31 LAB Phone number Breakdown
PRG 420 Week 1 Java 1.29 LAB Expression for Calories Burned During Workout
The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age * 0.074) – (Weight * 0.05741) + (Heart Rate * 0.4472) – 20.4022 ) * Time / 4.184 Men: Calories = ( (Ago * 0.2017) – (Weight * 0.09036) + (Heart Rate * 0.6309) – 55.0969 ) * Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for women and men. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf(“%.2f”, yourValue)) Ex: If the input is: 49 155 148 60 the output is: Women: 580.94 calories Men: 891.47 calories PRG 420 Week 1 Lab 1.29 You May Also Like: PRG 420 Week 1 Java 1.13 LAB Right-facing arrow PRG 420 Week 1 Java 1.30 LAB Mad Lib PRG 420 Week 1 Java 1.31 LAB Phone number Breakdown
PRG 420 Entire Course
PRG420 Entire Course includes:
PRG 420 Week 1 Individual Assignment,
PRG 420 Week 2 Individual Assignment,
PRG 420 Week 3 Individual Assignment,
PRG 420 Week 4 Individual Assignment,
PRG 420 Week 5 Individual Assignment
Each tutorial includes a Netbeans project and few screenshots. All source code is fully commented.
PRG 420 Week 1 Individual Assignment
You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 4 Individual Assignment Simple Commission Calculation Program Part 3
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program that creates and accesses an array of integers. The Java™ program you write should do the following:
Create an array to hold 10 integers Ask the user for an integer. Note: This code has already been written for you. Populate the array. Note: The first element should be the integer input by the user. The second through tenth elements should each be the previous element + 100. For example, if the user inputs 10, the first array value should be 10, the second 110, the third 210, and so on.
• Display the contents of the array on the screen in ascending index order.
Complete this assignment by doing the following:
Download and unzip the linked Week Four Coding Assigment Zip File. Read each line of the file carefully, including the detailed instructions at the top. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 LINE 4 LINE 5 Comment each line of code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above.
Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab.
PRG 420 Week 4 Screenshot You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 3 Individual Assignment Simple Commission Calculation Program Part 2
For this assignment, you will apply what you learned in analyzing for, while, and do-while loops by writing these statements yourself. The Java™ program you write should do the following:
Display a pyramid of asterisks onscreen (i.e., a nested for loop) Display the integers 10 to 1 in decreasing order, one number per line (i.e., a while/do-whlie loop) Add 7 until the sum becomes greater than 157, at which point the program should display both the sum and the number of 7s added
Complete this assignment by doing the following:
Download and unzip the linked Week Three Coding Assigment Zip File. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 Comment each line of code you add to explain what you intend the code to do and why you chose each type of loop. Test and modify your Java™ program until it runs without errors and produces the results as described above.
Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab.
PRG 420 Week 3 Screenshot You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 2 Individual Assignment Simple Commission Calculation Program Part 1
For this assignment, you will apply what you learned in analyzing Java™ code so far in this course by writing your own Java™ program. The Java™ program you write should do the following:
Accept user input that represents the number of sides in a polygon. Note: The code to do this is already written for you. If input value is not between 3 and 5, display an informative error message If input value is between 3 and 5, use a switch statement to display a message that identifies the correct polygon based on the number of sides matching the input number (e.g., triangle, rectangle, or polygon)
Complete this assignment by doing the following:
Download tnd unzip ahe linked Week Two Coding Assigment Zip File. Read the file carefully, especially the explanatory comments of what the existing code does. Add your name and the date in the multi-line comment header. Refer to the following linked Week Two Recommended Activity Zip File to see examples of how to code all of the Java™ statements (i.e., switch, println(), and if-then-else) you will need to write to complete this assignment. Replace the following lines with Java code as directed in the file:
• LINE 1
• LINE 2
Comment each line of code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above.
Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab.
PRG 420 Week 2 Individual Assignment You May Also Like: PRG 420 Week 1 Individual Assignment Hello World PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling
PRG 420 Week 1 Individual Assignment Hello World Program
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program. The Java™ program you write should do the following:
Display a prompt on the console asking the user to type in his or her first name Construct the greeting string “Hello, nameEntered!” Display the constructed greeting on the console
Complete this assignment by doing the following:
Download and unzip the linked zip file. Add comments to the code by typing your name and the date in the multi-line comment header. Replace the following lines with Java™ code as directed in the file: LINE 1 LINE 2 LINE 3 LINE 4 Comment each line of code you add to explain what you intend the code to do. Test and modify your Java™ program until it runs without errors and produces the results as described above.
Note: Refer to this week’s analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab.
PRG 420 Week 1 Individual Assignment You May Also Like: PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon PRG 420 Week 3 Individual Assignment For While and Do While Loops PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers PRG 420 Week 5 Individual Assignment Exception Handling