java code needed ription Three Numbers (Required Exercise) In this exercise we'll be using a slightly different
Fantastic news! We've Found the answer you've been seeking!
Question:
java code needed
Transcribed Image Text:
ription Three Numbers (Required Exercise) In this exercise we'll be using a slightly different combination of things we've worked on before, starting from scratch again. No individual element here is new, so read the instructions carefully and break the task down into steps. In the skeleton you are given a class ThreeNumbers which starts with an array called num, and little else. Below the indicated comment you need to do the following (you may want to think about the order): • Create a standard main method. In the main method you need to: o Create a scanner object to be used to read things in o Print a prompt to "Enter the first number: ", without a new line after it. Read an int in from the user and store it as the first element of num. o Print a prompt to "Enter the second number: ", without a new line after it. Read an int in from the user and store it as the second element of num. • Print a prompt to "Enter the third number: ", without a new line after it. o Read an int in from the user and store it as the third element of num. Print "The sum of the three numbers is <sum>.", with a new line after it, where <sum> is replaced by the actual sum of the elements of num. o Print "The average of the three numbers is <avg>.", with a new line after it, where <avg> is replaced by the actual average (rounded down, so you can use integer division) of the the elements of num. Remember that computers aren't clever, so note the formatting and punctuation, especially in the feedback of the tests. Note also that part of the task is to use the array num. Although you can print out the correct things without it, you cannot pass the task. Three Numbers (Required Exercise) ThreeNumbers.java 1 import java.util.Scanner; 2 3 /* 4 *@author Raymond Lister 5 * @version March 22, 2015 6 */ 7 class ThreeNumbers 8 { 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 } 28 static int [] num = 0, 0, 0); // DO NOT CHANGE ANYTHING ABOVE THIS COMMENT LINE //Create a main method. //Create a Scanner //Prompt the user as per the description and read in an int. //Prompt the user as per the description and read in another int. //Prompt the user as per the description and read in the third int. 7/Calculate the sum. //Calculate the average. //Print out the messages about the sum and average. //Don't forget to put a closing brace at the end of the main method. ription Three Numbers (Required Exercise) In this exercise we'll be using a slightly different combination of things we've worked on before, starting from scratch again. No individual element here is new, so read the instructions carefully and break the task down into steps. In the skeleton you are given a class ThreeNumbers which starts with an array called num, and little else. Below the indicated comment you need to do the following (you may want to think about the order): • Create a standard main method. In the main method you need to: o Create a scanner object to be used to read things in o Print a prompt to "Enter the first number: ", without a new line after it. Read an int in from the user and store it as the first element of num. o Print a prompt to "Enter the second number: ", without a new line after it. Read an int in from the user and store it as the second element of num. • Print a prompt to "Enter the third number: ", without a new line after it. o Read an int in from the user and store it as the third element of num. Print "The sum of the three numbers is <sum>.", with a new line after it, where <sum> is replaced by the actual sum of the elements of num. o Print "The average of the three numbers is <avg>.", with a new line after it, where <avg> is replaced by the actual average (rounded down, so you can use integer division) of the the elements of num. Remember that computers aren't clever, so note the formatting and punctuation, especially in the feedback of the tests. Note also that part of the task is to use the array num. Although you can print out the correct things without it, you cannot pass the task. Three Numbers (Required Exercise) ThreeNumbers.java 1 import java.util.Scanner; 2 3 /* 4 *@author Raymond Lister 5 * @version March 22, 2015 6 */ 7 class ThreeNumbers 8 { 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 } 28 static int [] num = 0, 0, 0); // DO NOT CHANGE ANYTHING ABOVE THIS COMMENT LINE //Create a main method. //Create a Scanner //Prompt the user as per the description and read in an int. //Prompt the user as per the description and read in another int. //Prompt the user as per the description and read in the third int. 7/Calculate the sum. //Calculate the average. //Print out the messages about the sum and average. //Don't forget to put a closing brace at the end of the main method.
Expert Answer:
Answer rating: 100% (QA)
Java code import javautilScanner public class ThreeNumbers public stat... View the full answer
Related Book For
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
How to find the expected utility of profit under each alternative crop Table 1. Annual Returns to Cropping Alternatives ($ profit / acre) Outcome Worst Bad OK Good Great Probability 0.1 0.2 0.4 0.2...
-
Do you agree that it is the behavior of leaders that largely determines employee engagement, as defined in the text? What might be some other factors that influence engagement? Discuss.
-
Suppose that a grocery store purchases 5 cartons of skim milk at the wholesale price of $1.20 per carton and retails the milk at $1.65 per carton. After the expiration date, the unsold milk is...
-
Establish a relationship between jet velocity and bucket velocity for maximum efficiency of Pelton turbine?
-
Your best friend, Mitch, was at a sales conference recently. During one of the breaks, he entered into a conversation with one of the other attendees, Darly, regarding the perks provided by their...
-
1 2 Part 2 of 15 points Skipped eBook P Deferences Required information The Foundational 15 (Algo) [LO14-2, LO14-3, LO14-4, LO14-5, LO14-6] [The following information applies to the questions...
-
Jackson et al. (1987) compared the precision of systematic and stratified sampling for estimating the average concentration of lead and copper in the soil. The 1-km2 area was divided into 100-m...
-
What is the future of strategic communications/public relations? Where is it headed? Explain. What is influencer marketing and why is it so important to marketers? Why is it important for marketers...
-
Assume the discount rate is 1 0 % . there are two projects A and B . project A is a one year project with an investment cost of 1 0 0 0 and a cash flow of 1 4 0 0 in year one. project b is an...
-
Briefly explain two intentional torts against persons AND two intentional torts against property? What is due process, and why is it important? In your opinion, should minors be able to avoid their...
-
(Present value of an annuity due) Determine the present value of an annuity due of $7,000 per year for 8 years discounted back to the present at an annual rate of 13 percent. What would be the...
-
Using the three overarching issues related to disability, Access, Discrimination, and Communication, provide at least one example per issue that illustrates this issue within the context of the...
-
Suppose you need to finance $ 2 0 , 0 0 0 for the purchase of a secondhand car. The interest rate on 4 - year auto loans is 1 2 % . What will your quarterly payment be ?
-
Please create T-accounts for a general ledger, a trial balance, income statement, statement of retained earnings, and a balance sheet with the following information. Date Journal Entry Cash Player's...
-
Two mutually exclusive investment alternatives are being considered. Alternative A requires an initial investment of $20,000 in a machine. Annual operating and maintenance costs are anticipated to be...
-
On April 20, 2010 there was a blowout and then an explosion aboard the Deepwater Horizon platform of the Macondo oil well being drilled in very deep water in the Gulf of Mexico. Eleven people aboard...
-
Hong Kongs Wah Shing Toys, one of the worlds largest toy manufacturers, has teamed up with Horizon Fuel Cell Technologies, a Singaporean developer of fuel-cell products, to lead the charge for...
-
Go to the library and search out print media (i.e., magazine and newspaper) advertising by a company, or one of its products or brands in different countries. Does this company use standardized or...
-
Online electronics retailer Kogan has announced an initial public offering to raise $50 million, with plans to list on the ASX at the end of June. Kogan, founded in 2006, said it would have a market...
-
For each company below, fill in the missing data. Each company is independent. Sales Beginning finished goods Cost of goods manufactured Ending finished goods Cost of sales Income Statement Company X...
-
Innovative Computers Pty Ltd began manufacturing inexpensive computers for the student market on 1 July 2018. The variable costs of manufacturing each computer are as follows. During the year ended...
Study smarter with the SolutionInn App