Write a program which reads user input using scanner

Assignment Help Computer Engineering
Reference no: EM132084656

Objectives:

Write a program which reads User Input using Scanner

Print formatted output using printf or DecimalFormat

Practice programming simple mathematical calculations

Instructions:

Samwise Gamgee has finally decided to submit his expense report for all of his adventures regarding his travels to Mordor. Part of those expenses are his stay at the Prancing Pony Inn located in Bree.

You are to write a simple Java program which will generate an Invoice for his stay at the Inn.

Your program should ask for user input which represents the following information:

the number of nights Sam stayed at the Inn

the tax rate for the taxes collected by the Shire

the tax rate for the taxes collected by the City of Bree

cost per night of staying at the Inn

The program should then print out an Invoice which is similar to:

The Prancing Pony Inn, City of Bree, Shire

Invoice for Samwise Gamgee

Cost per night: $110

Shire Taxes per night: @Rate of 6.75% is $7.42

City of Bree Taxes per night: @Rate of 1.25% is $1.37

Total Cost per night: $118.79

Number of nights Stayed: 4

Total Cost: $475.16

(Bonus: Change the program so that the name of the Person and the two Tax Districts can also be entered by the user. These names should be allowed to contain spaces)

Reference no: EM132084656

Questions Cloud

What was the eugenics movement : What was the eugenics movement, and how did some of these ideas play out in the 20th century?
Write a small test program that gets ten valid integers : Write a small test program that gets 10 valid integers from the user and stores the numeric values in an array.
How was darwin influenced by the field of economics : How was Darwin influenced by the field of economics? What was the nature of Malthus' argument? How did Darwin incorporate these ideas into his theory?
Geology say about the timescales of earth : What did "uniformitarian" geology say about the timescales of earth's history, and the rate at which change occurred? Are there any examples of "catastrophism"
Write a program which reads user input using scanner : Write a program which reads User Input using Scanner. Print formatted output using printf or DecimalFormat
What evolutionary theories were proposed prior to darwin : What evolutionary theories were proposed prior to Darwin? How were these theories different from Darwin's theory:
What kind of experiments did mendel perform : What kind of experiments did Mendel perform, and why did he postulate the existence of an inherited "unit" that could not be seen?
Period of the industrial revolution : What are the similarities/differences in the uses of power in the medieval era, the period of the Industrial Revolution, and our own era?
Implement macros getstring and displaystring : Implement macros getString and displayString. The macros may use Irvine's ReadString to get input from the user, and WriteString to display output.

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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