hello guys i have a bunsh of questions in java and algorithm
most of them i didnt have a problem in them but two i had a diffculty in them could u help me in them please coz its urgent .
the questions are:
Q1.DVD Sales and Shipping Algorithm Design:
You are to design an algorithm to calculate the total cost of a customer order for a number of DVDs. The total is comprised of a component for the DVDs, and also a shipping cost. The costs are determined as follows:
• DVDs cost $19.95 each
• For every 4 DVDs chosen, the 5th one is free (so if the customer chooses
10 DVDs, they pay for 8 and get 2 free)
• The shipping cost is based on the following table:
Number of DVDs : Cost per item to Ship
1 to 4 DVDs : $2.00 per DVD
5 to 8 DVDs : $1.75 per DVD
9 to 13 DVDs : $1.50 per DVD
14 or more : $1.00 per DVD
Design an algorithm that will prompt an operator for the number of DVDs being
purchased. It is then to calculate the DVD charge as well as the shipping cost
based on the details above. The final total should then be displayed.
Q3. Train Ticket Algorithm Design:
You are to design an algorithm to run a train ticketing machine. The machine
operates by allowing a user to choose their desired ticket through a series of
menus. Based on the selections, the machine calculates a total, accepts money from the user, calculates any change owing and then allows the user to collect their ticket and change.
Below is the series of menus the user must choose from:
Menu 1: Age Group
A. Child
B. Adult
C. Concession
Menu 2: Zone Choice
A. Zone 1
B. Zone 2
C. Zone 1 and 2
D. Cancel
Menu 3: Duration
A. 2 hours
B. All Day
C. Cancel
The user will then be given the price and should then enter the amount being
tendered into the system, where the system will then calculate any change owing.
The price of a particular ticket depends on the selections. The description below
details the pricing:
• Child: Always free
• Adult: $2.00 for a 2 hour ticket in only one zone. Add $1.00 to travel both
zones. Add $2.00 to travel all day.
• Concession: $1.50 for a 2 hour ticket in only one zone. Add $0.50 to travel
both zones. Add $1.00 to travel all day
Note that the user can cancel during the process. This option takes them back to the beginning. Your program should also handle any invalid input from the user with the following message: “Invalid input – please re-enter choice”
thank you guys very much becouse i couldnt solve these two questions, but the rest of the questions easy except these two.
thanx
most of them i didnt have a problem in them but two i had a diffculty in them could u help me in them please coz its urgent .
the questions are:
Q1.DVD Sales and Shipping Algorithm Design:
You are to design an algorithm to calculate the total cost of a customer order for a number of DVDs. The total is comprised of a component for the DVDs, and also a shipping cost. The costs are determined as follows:
• DVDs cost $19.95 each
• For every 4 DVDs chosen, the 5th one is free (so if the customer chooses
10 DVDs, they pay for 8 and get 2 free)
• The shipping cost is based on the following table:
Number of DVDs : Cost per item to Ship
1 to 4 DVDs : $2.00 per DVD
5 to 8 DVDs : $1.75 per DVD
9 to 13 DVDs : $1.50 per DVD
14 or more : $1.00 per DVD
Design an algorithm that will prompt an operator for the number of DVDs being
purchased. It is then to calculate the DVD charge as well as the shipping cost
based on the details above. The final total should then be displayed.
Q3. Train Ticket Algorithm Design:
You are to design an algorithm to run a train ticketing machine. The machine
operates by allowing a user to choose their desired ticket through a series of
menus. Based on the selections, the machine calculates a total, accepts money from the user, calculates any change owing and then allows the user to collect their ticket and change.
Below is the series of menus the user must choose from:
Menu 1: Age Group
A. Child
B. Adult
C. Concession
Menu 2: Zone Choice
A. Zone 1
B. Zone 2
C. Zone 1 and 2
D. Cancel
Menu 3: Duration
A. 2 hours
B. All Day
C. Cancel
The user will then be given the price and should then enter the amount being
tendered into the system, where the system will then calculate any change owing.
The price of a particular ticket depends on the selections. The description below
details the pricing:
• Child: Always free
• Adult: $2.00 for a 2 hour ticket in only one zone. Add $1.00 to travel both
zones. Add $2.00 to travel all day.
• Concession: $1.50 for a 2 hour ticket in only one zone. Add $0.50 to travel
both zones. Add $1.00 to travel all day
Note that the user can cancel during the process. This option takes them back to the beginning. Your program should also handle any invalid input from the user with the following message: “Invalid input – please re-enter choice”
thank you guys very much becouse i couldnt solve these two questions, but the rest of the questions easy except these two.
thanx
Comment