Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedAnswer 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago