#include <iostream>
using namespace std;
int main( )
{
float rand, cent, pounds, shillings;
cout << "Enter Pounds " << endl;
cin >> pounds;
cout << "Enter Shillings " << endl;
cin >> shillings;
pounds =1;
shillings =1;
// enter amount while both pounds and shillings is not equal to 0
while
(pounds != 0 && shillings != 0)
{
cout << "Enter Pounds " << endl;
cin >> pounds;
cout << "Enter Shillings " << endl;
cin >> shillings;
// Calculate & convert pounds to rands
rand = (pounds * 2 );
// Calculate & convert shillings to cent
cent = (shillings * 10);
cout << "The pound is equal to R "<<rand << endl;
cout <<"Shillings equells to "<< cent << " C "<< endl;
}
return 0;
}
loeto 0 Newbie Poster
Recommended Answers
Jump to PostIt would be nice to know what this program is intended to do. It is trying to convert pounds and shillings to something, but I don't know what.
Jump to PostOk Ancient Dragon
The program has to convert pounds to rands, and also convert shillings to cents also display the results. Asuming that there are 20 shillings in a pound and that 1 shilling to 10 cents.
The program to run in each line the first entry is the number …
Jump to Postit would help if you would learn how to format your code better.
int main() { int Rand, Cent, Pounds, Shillings; // pound = 20 shillings do { cout << "Enter Pounds: " << endl; cin >> Pounds; cout << "Enter Shillings: " << endl; cin >> …
All 11 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
loeto 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
loeto 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
loeto 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
loeto 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
loeto 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.