• Post Reply Bookmark Topic Watch Topic
  • New Topic
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
Your application should read the notebook number and the quantity sold.
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
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
Your application should read the notebook number and the quantity sold.
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

The assignment actually tells you what to do.
 
yara hussien
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is my code i just couldn't figure it out


 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic