Question: Answer all questions Lab 10: Module 6- Arrays 1. Write array declarations for the following: (3 pts) a. 60 double interest rates b. 20 integer

 Answer all questions Lab 10: Module 6- Arrays 1. Write arrayAnswer all questions

Lab 10: Module 6- Arrays 1. Write array declarations for the following: (3 pts) a. 60 double interest rates b. 20 integer quiz scores. c. 26 characters, each representing a letter of the alphabet. How do you reference the 3d element? How do you reference the last element? How do you reference the first element? 2. Write a Java program to input 4 values into a double array named prices. After the user has entered the data, have your program output the values and total of the values. Now output the values in reverse order. (PricesinAndOut.java) (5 pts) 3. Write a declaration to store these integers 10, 75, 34, 20, 15, 22, 98, 42, 15, 30, 40, 20 into an array named randomnums. Write the code to count all the occurrences of 15 and then display the count. (RandomNums,java) (4 pts) Add the code to create a new integer array that has twice the number of elements as randomnums and assign the values in randomnums to the new array. Display the new array, (3 pts) Try to think of a way for the program to calculate twice the number of elements for the new array. Write a program that declares three arrays named price, aty, and amt. Each array should be declared in main0 and capable of holding 3 values numbers for price and qty (quantity). (ShoppingCart java) (4 pts) 4. up Write a method to fill the amt array with the product of the corresponding elements in price and gty (3 pts -create a method within the ShoppingCart class) Allow users to change the price and qty for three items. Display the values in the amt array after the three items have been entered. (3 pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!