Question: An array must be smaller than 100,00 elements. True or False Second section Choose three out of the six exercises labeled A through F A.
- An array must be smaller than 100,00 elements. True or False
Second section
Choose three out of the six exercises labeled A through F
A. Write a Java program that asks the user to enter First or Economy or Walk. If the user enters First display $1000.00. If they enter Economy display $120.00 and if they enter Walk display Free.
B. Write a java program that creates the following two arrays:
String[] machines = {Model100, Model 200, Model 5000};
int[] output = {456,432,37211};
Write the code that will ask the user for machine model type. Display the corresponding output value.
C. Write a java program that asks the user for five integers. Display the largest and smallest integer of the five.
D. This exercise requires two classes: CalcArea and UserInput.
The first class, CalcArea has two methods. The first method is named calcCircleArea. The second method is named calcSquareArea.
The method calcCircleArea returns a type of double and requires one double as an input argument. calcCircleArea takes the input argument and multiplies it by itself (squares it) and then multiplies that by Math.PI. It returns the total, calculated value.
The method calcSquareArea returns a type of double and requires one double as an input argument. calcSquareArea takes the input argument and multiplies it by itself(squares) and returns the result.
The second class, UserInput, creates an object of type CalcArea, then asks the user for a number. The program then asks the user if they want the area of a circle or the area of a square. It they chose circle the program calls the calcCircleArea method and displays the results. If they chose the area of a square then the program call the calcSquareArea method and displays the results.
E. Create a java program that asks for the user for their id number and their location code. Print out the id number, their location code and location address. Look up the location address in an array using the information below.
For example: For person 101 and location code C100 your address is 100 Main Street is the result for input of 101 and C100.
Use this table to find the proper address using the location code:
Location code Address
N200 2002 Macro Lane
H100 1000 Buffer Blvd
C100 100 Main Street
N100 2002 Washington St
F.Create a java program that asks the user for their name and their birthdate. Display their name and birthdate with / between the month, day, and year. For example: Jane Doe 3/12/2001. When asking for their birthdate, ask for the month, day, and year separately.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
