Write a program

User Generated

icuvyy

Programming

Description

An algorithm – a regular text file

Java Source code – a Java source file

Write a program that creates customers’ bills for a carpet company when the information below is given:

The customer’s last name, first name

Length and width of the carpet in feet

Carpet price per square foot

First name and last name can be entered in any case. Length and width must be entered as integers. Carpet price per square foot can be a floating-point number or an integer.

The Customer ID must contain the following three parts in order.

First initial of a capitalized first name

First five characters of a capitalized last name (Assuming the user-entered last name is at least five-character long)

A random two-digit number in the range 10 to 99(inclusive).

The tax rate is 8.5%, and it must be stored as a constant. The tax rate must be formatted into percentage format without leading zeros. Leading zeros must be used to make sure there are at least three digits in each formatted measurement data. All charge data must be formatted into required formats with leading zeros and trailing zeroes as shown.

Sample Run 1:

Enter your first name: John

John Enter your last name: Smith

Enter length of room (feet): 23

Enter width of room (feet): 13

Enter cost per square foot: 14.20

CUSTOMER

Last Name Smith

First Name John

ID JSmith45

MEASUREMENT

Length 023 feet

Width 013 feet

Area 299 square feet

CHARGES

Description Cost/Sq.ft Charges ---

Carpet 14.20 $4245.80

Tax 8.50% 0360.89 -

Total $4606.69

Sample Run 2:

Enter your first name : joHn Notice the name is not entered in title case.

Enter your last name: smith

Enter length of room (feet): 23

Enter width of room (feet): 13

Enter cost per square foot: 14.20

CUSTOMER

Last Name Smith Notice the name is displayed in title case. First Name John

ID JSmith45

MEASUREMENT

Length 023 feet

Width 013 feet

Area 299 square feet

CHARGES

Description Cost/Sq.Ft. Charges

Carpet 14.20 $4245.80

Tax 8.50% 0360.89

Total $4606.69

Sample Run 3:

Enter your first name: Joe

Enter your last name: Whitney

Enter length of room (feet): 14

Enter width of room (feet): 2

Enter cost per square foot: 5.00

CUSTOMER

Last Name Whitney

First Name Joe

ID JWhitn23

MEASUREMENT

Length 014 feet

Width 002 feet

Area 028 square feet

CHARGES

Description Cost/Sq.Ft. Charges --

Carpet 05.00 $0140.00

Tax 8.50% 0011.90

Total-----------------------------------------------------------------------------------------------

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

This variant is close to what is required. The uploaded zip file contains bot...


Anonymous
Very useful material for studying!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
Similar Content
Related Tags