C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 30th, 2009, 09:22 AM
fatkitty420 fatkitty420 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 3 fatkitty420 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 40 sec
Reputation Power: 0
General - C++ Help on homework again

I've been presented with this question:


Background
• A local business owner wants a program to help his employees redeem coupons for prizes. The employees can’t do math very well and need a program that allows them to enter input about the customer and get back output about how prizes and coupons.
• Each time a customer wins a game, they are awarded coupons for redemption. Customers then bring the coupons to the employees who count them and tell customers what items they can get and how many coupons they have left.
• Customers can redeem the coupons for several different things:
Stuffed animals cost 200 coupons
Water pistols cost 75 coupons
Pop Rocks cost 35 coupons
Jewelry costs 5 coupons


Functionality Changes
The program should now do the following:

1. The employee should first see a prompt asking them how many coupons are being redeemed.
o If the amount is less than or equal to zero, ask them to try again.
o If the amount is any positive number other than zero, capture the amount and go to the next step.
2. Clear the screen and show the prizes menu. It should:
o Echo the number of tickets back to the screen
o Tell the employee to enter:
S for stuffed animals (200 points)
W for water pistol (…)
P for pop rocks (…)
J for jewelry (…)
R for Error! I entered the number of coupons wrong!
If the employee selects R, return to the previous step, otherwise, continue.

X for Exit
If the employee selects X, tell the employee how many coupons to return and then pause the screen.

For choices S,W,P or J-
Determine from the number of coupons if the customer can have that prize.
• If the customer has enough coupons, output a message saying to award the customer that prize and deduct the coupons.
o If any coupons remain, return to the prizes menu.
• If the customer does not have enough, return to the prizes menu.

Here's some hints that I was provided.


Here’s some hints:
3. There should be a while loop to validate the number of coupons. This is an outside loop – you may need to return to this if the employee decides that they entered the number of coupons wrong!
4. The prizes menu needs to be inside the inner loop so you can return to it if there are not enough coupons or there are coupons remaining.
5. You will likely need to use continue or break statements!!!


I have no idea how to do this. I previously made a similar program with loops but it seems like my teacher is jumping ahead a few chapters and leaving me behind.

Help please, I'd really appreciate it. I'm using Bloodshed's Dev C++ to compile.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - C++ Help on homework again


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek