Java program to input 4 values into an array named prices

Assignment Help Basic Computer Science
Reference no: EM132301995

1. Write array declarations for the following:

a. 60 double interest rates. How do you reference the 3rd element?

b. 20 integer scores. How do you reference the last element?

c. 25 characters, each representing a code. How do you reference the first element?

2. Write a Java program to input 4 values into an array named prices. After the data has been entered by the user, have your program output the values. Now output the values in reverse order.

3. Write a java program that stores these integers 10, 20, 30, 40, 20 in an array named nums. Write the code to count all the occurrences of 20 and then display the count.

Add the code to create a new integer array that has twice the number of elements as nums and assign the values in nums to the new array. Display the new array.

Try to think of a way for the program to calculate twice the number of elements for the new array.

4. Write a program that declares three arrays named price, qty, and amt. Each array should be declared in main() and capable of holding 3 values. Make up numbers for price and quantity.  

Write a method to fill the amt array with the product of the corresponding elements in price and qty.  

Display the values in the amt array in main.

This problem will be useful when you work on Project Five.

5. Go back to your Zeller's code. Set up an array like this:

String [] day = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

Replace the switch to display the day with a one statement System.out.printlnjQuery22407234776868287549_1556481381981?.

Reference no: EM132301995

Questions Cloud

What are some of the advantages of physical stores : What are some of the advantages of physical stores in building customer relationships? Reflect on a time when you had a great experience and when you had a poor
Discuss some hardening techniques or products : Discuss some hardening techniques or products you have used for Workstations
Prepare a second variable costing statement : Prepare a second variable costing statement assuming 90% of all the books in each category purchased were actually sold. Prepare a third variable costing.
Prepare the bank reconciliation for party supplies ltd : ACC566 Acc Systems and Processes - Charles Sturt University - Prepare journal entries to account for all transactions that took place
Java program to input 4 values into an array named prices : After the data has been entered by the user, have your program output the values. Now output the values in reverse order.
Oracle database tables using sql data definition language : Please also explain how to create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in the metadata.
Describe code to someone who may be viewing : Comment your source code and describe your code to someone who may be viewing it for the first time.
Sample thesaurus stored in a python dictionary object : The company has set you up with a sample thesaurus stored in a Python dictionary object. Here's the code that represents the thesaurus:
What is in your spam folder : What's in your spam folder? Consider that for a moment, then view these TED Talks hosted on YouTube:

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd