Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For each of the following problems, complete the four steps pre-programming phase: i. Analyze the problem (PAC) ii. Develop the IPO Chart iii. Develop the

image text in transcribedimage text in transcribedimage text in transcribed

For each of the following problems, complete the four steps pre-programming phase: i. Analyze the problem (PAC) ii. Develop the IPO Chart iii. Develop the algorithm (draw the flowchart and/or write the pseudocode) Then, based on the algorithm you have written, write a complete Java program for each problem. Use modular programming, i.e. methods, where appropriate. 1. A mail-order house sells five products whose retail prices are as follows: Product 1 = RM2.98; product 2 = RM4.50; product 3 = RM9.98; product 4 = 4.49 and product 5 = RM6.87.Write an algorithm and draw a flowchart that reads a series of pairs of numbers as follows: a. product number b. quantity sold You must use case logic structure to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use sentinel- controlled loop, -9999, to determine when the program should stop looping and display the final results. Use separate methods to: read the product number determine the price of each product based on the product number . read the quantity of the product sold calculate the total price for each product sold display the total price 2. Draw a flowchart and write an algorithm that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values, not counting zeros. Your program ends with the input O. Display the average as a floating-point number. (For example, if you entered 1, 2 and 0, the average should be 1.5). Use separate methods to: read number count the positive and negative numbers calculate the total of the numbers calculate the average display the numbers of positive and negative values, the total and average . 3. The formula for converting centigrade temperatures to Fahrenheit is F = 32 + c 180.0 100.0) Write a program that asks the user to enter a temperature reading in centigrade and then prints the equivalent Fahrenheit value. It then asks the user to enter a Fahrenheit value and prints out the equivalent centigrade value. Run the program several times. Be sure to include at least one negative temperature reading in your test cases. Provide separate functions as required by your design. One possible design is shown in the figure below. (Your main function should have only function calls.) temperatures Celsius Fahrenheit get Celsius Celsius to Fahrenheit print Fahrenheit get Fahrenheit Fahrenheit to Celsius print Celsius

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago