Programming C ++

This is a discussion on Programming C ++ within the Help Desk forums, part of the Computer Database category; Anyone no anything about programming in C++?...


Go Back   Rapmusic.com > Download Center > Computer Database > Help Desk

Reply
 
LinkBack Thread Tools Display Modes
Old 10-05-2007, 09:12 PM   #1 (permalink)
Yodel At Me
 
Join Date: Sep 2001
Location: Ði®Ty-Jé®$Ey
Posts: 9,976
blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!
Programming C ++

Anyone no anything about programming in C++?
__________________
Ill play tug of war with your life line
blaquest is offline  
Reply With Quote
Old 10-05-2007, 10:01 PM   #2 (permalink)
...
 
Messiah's Avatar
 
Join Date: Nov 2003
Posts: 8,097
Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!Messiah will do you doggie style!
i'll post up some information for u shortly. get u an ebook and what not.
Messiah is offline  
Reply With Quote
Old 10-06-2007, 10:39 AM   #3 (permalink)
Yodel At Me
 
Join Date: Sep 2001
Location: Ði®Ty-Jé®$Ey
Posts: 9,976
blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!blaquest Got GAME!
That would be helpful....But I have this assignment and I have no idea where to go from here...

Assignment

CS 115 Programming Assignment 2
Fall 2007
Due Date: Tuesday 9 Oct 2007 - by Midnight
This PA is a variation on PP 3 in Ch 4 on parameters and overloading.

It is also an extension of our PA 1.

You will do the following to PA 1:

Create a function called ReadRoundedAmount that sends back to the function main both the original amount read from the keyboard, and that amount converted to pennies and rounded to the nearest penny.
Create the function named ConputeCoin that is described in the book.
Create a function named WriteChange that writes a line of output that looks as follows:
$37.79 = 37 dollars, 3 quarters, 0 dimes, 0 nickles, 4 pennies.
This function should have parameters that enable it to be called by the function main.

Use a loop in function main that calls these functions at the right time, in the right order, as often as the user provides input that is not zero. The main function should declare any variables that are needed to call the functions and initialize any as needed.
Hint: start with a copy of PA 1. Add each new function one at a time and move some code from function main to the new function. Test that the program still works as before. Finally, add a loop to execute repeatedly until the user enters a zero.

If done correctly, this program will cleanly separate input, calculation, output, and control in the various functions that it containes



What I have done.....

#include <iostream>

int main()
{
using std::cout;
using std::endl;
using std::cin;

double output;
int intOutput;

cout << "Enter dollar amount: ";
while (!(cin >> output))
{
cin.clear();
while (cin.get() != '\n') {}
cout << "as a double: ";
}

intOutput = (int) (100 * output + 0.5);

cout << "$" << output << " = ";
cout << intOutput / 100 << " dollars, "
<< ( intOutput % 100) / 25 << " quarters, "
<< ((( intOutput % 100) % 25) / 10 ) << " dimes, "
<< ((( intOutput % 100) % 25) % 10 ) / 5 << " nickles, "
<< ((( intOutput % 100) % 25) % 10 ) % 5 << " pennies.";

return 0;
}


Anyone can help me please do so because I am lost from here
__________________
Ill play tug of war with your life line
blaquest is offline  
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -4. The time now is 04:51 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright (c) 800Media.com
Copyright © 1998-2008 800Media, Inc. All Rights Reserved.
No portions of this site may be duplicated without permission from 800Media, Inc.
Advertising | Privacy Policy