programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Jeanne Boyarsky
• Ron McLeod
• Paul Clapham
• Liutauras Vilda
Sheriffs:
• paul wheaton
• Rob Spoor
• Devaka Cooray
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Carey Brown
• Frits Walraven
• Tim Moores
Bartenders:
• Mikalai Zaikin

# can you bleas help me i cant figure how to put the sixth choice in the solution

Greenhorn
Posts: 9
• Number of slices to send:
Optional 'thank-you' note:
The book store at BZU sells five types of notebooks whose retail prices are as follows: notebook 1, \$2.98; notebook 2, \$4.50; notebook 3, \$9.98; notebook 4, \$4.49; notebook 5, \$6.87 and it offers a package of all the products at \$20.00 (option 6), that is, 4 \$ will be added to the total of each notebook (i.e., if you bought 2 packages then 8 \$ will be added to each notebook).
Notes:
• Use a switch statement to determine the retail price for each notebook.
• Calculate and display the total amount (\$) of all products sold.
• Let the user enter 0 to exit the loop and show the results.
Below is a sample output for the application …

Enter notebook number (1-6) (0 to stop): 5
Enter quantity sold: 3
Enter notebook number (1-6) (0 to stop): 2
Enter quantity sold: 4
Enter notebook number (1-6) (0 to stop): 6
Enter quantity sold: 2
Enter notebook number (1-6) (0 to stop): 0
notebook 1: \$8.00
notebook 2: \$26.00
notebook 3: \$8.00
notebook 4: \$8.00
notebook 5: \$28.61

Rancher
Posts: 1093
29
• Number of slices to send:
Optional 'thank-you' note:
OK, I see  you posted the assignment, but what have you done so far and what is  your question?

yara hussien wrote:The book store at BZU sells five types of notebooks whose retail prices are as follows: notebook 1, \$2.98; notebook 2, \$4.50; notebook 3, \$9.98; notebook 4, \$4.49; notebook 5, \$6.87 and it offers a package of all the products at \$20.00 (option 6), that is, 4 \$ will be added to the total of each notebook (i.e., if you bought 2 packages then 8 \$ will be added to each notebook).
Notes:
• Use a switch statement to determine the retail price for each notebook.
• Calculate and display the total amount (\$) of all products sold.
• Let the user enter 0 to exit the loop and show the results.
Below is a sample output for the application …

Enter notebook number (1-6) (0 to stop): 5
Enter quantity sold: 3
Enter notebook number (1-6) (0 to stop): 2
Enter quantity sold: 4
Enter notebook number (1-6) (0 to stop): 6
Enter quantity sold: 2
Enter notebook number (1-6) (0 to stop): 0
notebook 1: \$8.00
notebook 2: \$26.00
notebook 3: \$8.00
notebook 4: \$8.00
notebook 5: \$28.61

Marshal
Posts: 79240
377
• Number of slices to send:
Optional 'thank-you' note:

Les Morgan wrote:OK, I see  you posted the assignment, . . .

The assignment actually tells you what to do.

yara hussien
Greenhorn
Posts: 9
• Number of slices to send:
Optional 'thank-you' note:
here is my code i just couldn't figure it out

Sheriff
Posts: 7125
184
• Number of slices to send:
Optional 'thank-you' note:
What problems are you having, specifically?

About your post: you almost got the code tags correct.  You need to surround the code with the start and end tags.  I fixed it for you this time.

yara hussien
Greenhorn
Posts: 9
• Number of slices to send:
Optional 'thank-you' note:
Thank you, i cant pass all the prices to my method and i think that its missing something which has a ling to the package choice but i just cant figure it out

Knute Snortum
Sheriff
Posts: 7125
184
• Number of slices to send:
Optional 'thank-you' note:
You need a data structure (a variable type) that can hold a bunch of extensions (price * quantity) by notebook number.  Can you think of should a type in Java?