Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 02-08-2003, 09:37 PM   #1
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
Need c++ help....

I am doing an assignment for my c++ class and i keep getting bogus numbers for some of my results. I attached the source if you want to look at it. Here is some info you might need:

"The holiday travel agency is putting together some travel packages for spring break. The rates are intended to last from February of this year through October of this year. They would like a program that will help them calculate the cost of a customer's trip. They have 4 destinations which they will offer at different prices:

Florida rate per day=$75.00 air fare=$195 round trip
Texas $65.00 $250
Cancun $110.00 $375.00
Bahamas $80.00 $300.00

- Since buisness is slow during July and August, there will be a price reduction for reservations during those months. The amount of the discount is based on their destination.
Florida and Cancun: one day free
Texas and Bahamas: 50% off the airfare

-There is also a discount based on how far ahead the reservation is made. This discount is to be applied to the final bill after any other discounts have been deducted.
1-4weeks in advance=no discount
5-6weeks in advance=5% discount
7-9weeks in advance=8% discount
10 or more weeks in advance = 10% discount

input: the user needs to enter 2 dates(reservation date and trip date) in the form of 3 integers. User will enter the number of days they are staying. User will enter F for Florida, T for Texas, C for Cancun, B for Bahamas.

output:

Holiday Travel Agency
Travel Cost Estimate

Reservation Date: xx/xx/xxxx
Trip Date: xx/xx/xxxx
Destination:
Number of days staying:

Cost of trip package: $xxxx.xx
Cost of airfare: $xxxx.xx
July/August discount: $xxxx.xx
Early booking discount:$xxxx.xx

Final Bill: $xxxx.xx

i am getting the right info for cost of dates, destinations, days, and airfare, but i am getting numbers around $40000 for all the other ones. It would be greatly appreciated if someone would look over my code and see what i am doing wrong. If you need any more info, just ask.

Also, how do i format the output so it is in monetary value? I tried doing the setiosflags stuff, but i kept getting error messages.

Thanks a lot ^dan
Attached Files
File Type: zip lab2.zip (2.0 KB, 39 views)
GSXdan is offline   Reply With Quote
Old 02-09-2003, 12:28 PM   #2
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
Well, it only took about 6 hours total for me to get it... I decided to completely redo it, and it worked. So thanks a lot to anyone who was looking at it. Here is the source code....


thanks again ^dan
Attached Files
File Type: zip lab2.1.zip (1.4 KB, 32 views)
GSXdan is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2