Calculate the average rainfall over a period of years

Assignment Help JAVA Programming
Reference no: EM132372869

Assessment type: Develop Java applications based on the given scenarios:

Purpose: This assignment will allow students to demonstrate their understanding of Java programming language covering all the concepts covered throughout the trimester and implementation of those concepts to develop a small java application based on the given specifications. This Assessment contributed to learning outcomes c and d.

Task Details: You are required to complete 5 practical exercises in Java that cover main topics in your outline.

Question 1: Java Fundamentals
Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase:
• The number of shares that Joe purchased was 1,000.
• When Joe purchased the stock, he paid $32.87 per share.
• Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock.

Two weeks later Joe sold the stock. Here are the details of the sale:
• The number of shares that Joe sold was 1,000.
• He sold the stock for $33.92 per share.
• He paid his stockbroker another commission that amounted to 2% of the amount he received for the stock.

Write a program that displays the following information:
• The amount of money Joe paid for the stock.
• The amount of commission Joe paid his broker when he bought the stock.
• The amount that Joe sold the stock for.
• The amount of commission Joe paid his broker when he sold the stock.
• Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the amount of profit that your program displays is a negative number, then Joe lost money on the transaction.)

Question 2:  Nested Loops

Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period.

Question 3: 2D Array

Write a program that lets the user enter four quarterly sales figures for six divisions of a company. The figures should be stored in a two-dimensional array. Once the figures are entered, the program should display the following information for each quarter.
• A list of the sales figures by division
• Each division's increase of decrease from the previous quarter. (This will not be displayed for the first quarter)
• The total sales for the quarter.
• The company's increase of decrease from the previous quarter. (This will not be displayed for the first quarter)
• The average sales for all divisions that quarter.
• The division with the highest sales for that quarter. Input validation: do not accept negative numbers for sales figures.

Question 4: Strings

Write a program that has two parallel arrays of String objects. One of the arrays should hold people's names and the other should hold their phone numbers.

Here are sample contents of both arrays.

name ArraySampleContents     phone ArraySampleContents
"Harrison, Rose"                       "555-2234"
"James, Jean"                          "555-9098"
"Smith, William"                        "555-1785"
"Smith, Brad"                           "555-9224"

The program should ask the user to enter a name or the first few characters of a name to search for in the array. The program should display all of the names that match the user's input and their corresponding phone numbers. For example, if the user "Smith," the program should display the following names and phone numbers from the list:

Smith, William: 555-1785
Smith, Brad: 555-9224

Reference no: EM132372869

Questions Cloud

Minimum and maximum systolic blood pressure : Approximately, what would be the minimum and maximum systolic blood pressure?
What are the degrees of freedom for variance : What are the degrees of freedom for variance? Compute the variance and standard deviation.
Uniform distributions and normal distributions in real-life : Can you provide some examples of some uniform distributions and normal distributions in real-life?
Find an approximate value : If X1, . . . , X45 is a random sample of 45 grocery bills, find an approximate value for P(X
Calculate the average rainfall over a period of years : ICT102 - Introduction to Programming - Kings Own Institute - Develop Java applications - calculate the average rainfall over a period of years.
Babies born in a particular hospital are boys : Suppose that 55% of all babies born in a particular hospital are boys. If 8 babies born in the hospital are randomly selected
What is the expected value of the game : A card is drawn from a standard 52 card deck. I'm the card is a king you win 20 otherwise you lose $2. What is the expected value of the game?
What is the appropriate distribution for the random variable : A fair die is rolled 12 times. Let X = the number of times an even number occurs on the 12 rolls. What is the appropriate distribution for the random variable X
State the random variable : According to the WHO MONICA Project the mean blood pressure for people in China is 128 mmHg with a standard deviation of 23 mmHg

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement the application using a singly linked list

Implement the following application using a singly linked list. This application accepts from console and stores a list of 10 names of your friends in the singly linked list

  Create class named horse

in Java Create a class named Horse that contains data fields for the name, color, and birth year. Include get and set methods for these field. Next, create a subclass named RaceHorse, which contains and addtional field that holds the number of rea..

  Implementing the add and remove methods

Prepare a class that maintains the top 10 scores for a game application, implementing the add and remove methods but using a doubly linked list instead of an array. Program has to be written in java

  Write a program called word guessing game.

Write a program called Word Guessing Game. Open the file FourLetterWords.txt and write the contents into an array of Strings (the file has 87 words in it).

  Write a program that reads an unspecified number

Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read.

  A java program where the user designates

a java program where the user designates how many games they would like to play (for example user inputs 10 games) then they play the game, if lets say there is a tie after 10 games the game continues until either the user of the computer wins by 2

  Write a generic class pair which has 2 type parameters

Write a generic class Pair which has 2 type parameters, F and S, representing the type of the first and second elements of a pair respectively

  Creates a professorraing class

Write a program that creates a professorRaing class consisting of professor ID and three ratings. The three ratings are used to evaluate easiness, helpfullness, and clarity. In a separate implementation class, allow the user to enter the values.

  Major design flaws and features of the airline

Use the Internet to locate airport kiosk page of one (1) major airline (such as United's Airport Kiosk page). Describe the key factors that constitute a user friendly check-in experience. Examine the major design flaws and features of the airline ..

  The data file being used contains records

The data file being used contains records with an employee's name, the number of hours they worked, and their hourly pay rate. Write a program to read the records of information and output (to the Output window or a dialog box) the employee's name..

  Negatively impacting health care currently

Identify and explain at least two events that are negatively impacting health care currently. Tell us why you think these items are negatively impacting the access to care, and make sure that you cite your references.

  Develop parent lock method asks for four digit password

Develop the parent lock method (turns lock on/off) which asks for 4 digit password. Navigating to any channel which is in range 99-110 must ask for password when parent lock is on.

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