Write a java program that stores integers

Assignment Help Basic Computer Science
Reference no: EM132301413

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: EM132301413

Questions Cloud

Describe the characteristics of ideal computer : What would you use it for? Would you choose a handheld, portable, desktop or workstation computer? Why?
Why are job-internship fairs beneficial for college students : Explain why are job and internship fairs beneficial for college students.
Draw a diagram for a non-deterministic finite state : Draw a diagram for a non-deterministic finite state machine for the language L = { w e {a,b,c}* : w contains aabbcc}
Discuss some hardening techniques or products : Discuss some hardening techniques or products you have used for Workstations.
Write a java program that stores integers : 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
Describe controversial corporate social responsibility : Specify one (1) controversial corporate social responsibility concern associated with your company. Submit a reference page with at least four (4) quality.
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.
Vendor names and email addresses : Create a program that keeps vendor names and email addresses in a dictionary as key-value pairs. The key should be vendor name.
Discuss how you decide to schedule your school assignments : Discuss how you decide to schedule your school assignments. Do your informal scheduling rules correspond to any of the rules described in this chapter?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Each office connects to via a wide area network (wan)

Application Architecture You have been tasked with building a payroll program for a large organization with offices spread across the United States. The company has one larger data center that each office connects to via a wide area network (WAN).

  How would you use one of the standard mib objects

How would you use one of the standard MIB objects to determine which one of the stations in a LAN is functioning as a bridge to the external network?

  Data are a sample of survival times

The following data are a sample of survival times (days from diagnosis) for patients suffering from chronic leukemia of a certain type:

  What is the probability of a person having cancer

What is the probability of a person having cancer given that the test does not indicate cancer? Round the probabilities to four decimal places.

  Quantity demanded and a change in demand

Using a supply curve explain change in the quantity demanded and a change in demand. give examples.

  Residual distribution policy

Harris Company must set its investment and dividend policies for the coming year. It has three independent projects from which to choose, each of which requires a $3 million investment. These projects have different levels of risk, and therefore d..

  What is the cost of joining r and s using a hash join

What is the cost of joining R and S using a sort-merge join? What is the minimum number of buffer pages required for this cost to remain unchanged?

  What drove starbucks to start expanding internationally

What drove Starbucks to start expanding internationally? How is the company creating value for its shareholders by pursuing an international expansion strategy?

  Give an example of a superclass and subclass

What does the super keyword represents and where can it be used? Give an example of a superclass and subclass.

  Difference between a column constraint

What is the difference between a column constraint and a table constraint and briefly discuss what "referential" constraints actions are. Provide at least one example. Please be detailed. No one sentence answer please.

  Which of the following is a feature of .net framework

Which of the following is a feature of .net framework

  Deduce an algorithm to pages from the partition

Suppose two use bits are provided. The first use bit is set when the page is first referenced. The second use bit is set when the page is referenced. Deduce an algorithm to pages from the partition, and list the pages.

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