Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

Write a complete Java program with the following specifications:

Display a welcoming message such as: "Welcome to Calculator Program!"

Prompt the user twice to enter two positive whole numbers, indicating first and second values, first value being smaller than the second one Calculate the square and cube of each number from first value to second value inclusive and then display an appropriately headered three column table with each row containing the number, its square and its cube respectively

Display a farewell message such as: "Goodbye, thank you for using our program!"

As an example, if the starting and finishing values were 2 and 4 respectively, the table in the output would look something like the following:

Number   Square    Cube
2               4            8
3               9            27
4               16          64

Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.

You may assume that the user of the program enters the inputs as required so that no input validation or error checking is necessary.

You need to submit java and class files, a short discussion to explain the logic on how the problem has been solved, and sample output (for detail please see marking guide and presentation below).

Task 5:

Problem Description:

Write a complete Java program to calculate the total charge corresponding to purchase of books at a fictional annual book festival. The price of each book is based on its category as described below:

Large print hardback books $10 each or three for $20
Small print hardback books $7 each or two for $10
All softcover books $5 each or five for $15

An example run of the program might look like the following (user input is shown in bold):
Welcome to the annual book festival!
Enter the number of large print hardback books purchased: 4
Enter the number of small print hardback books purchased: 6
Enter the number of softcover books purchased: 7

Your total bill is: $85
Would you like to calculate another bill (y/n)? y
Enter the number of large print hardback books purchased: 6
Enter the number of small print hardback books purchased: 0
Enter the number of softcover books purchased: 10
Your total bill is: $70
Would you like to calculate another bill (y/n)? n
Total sales in this session: $155
Goodbye!

Note that the program will continue calculating bills until the user enters n in response to the last prompt asking if another calculation is required.

Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.

You may assume that the user of the program enters the inputs as required so that no input validation or error checking is necessary.

You need to submit java and class files, a short discussion to explain the logic on how the problem hasbeen solved, and sample output (for detail please see marking guide and presentation below).

Java, Programming

  • Category:- Java
  • Reference No.:- M92745591

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As