Click here to Skip to main content
16,004,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem Refreshing Screen Pin
ThatsAlok19-Apr-05 18:14
ThatsAlok19-Apr-05 18:14 
GeneralRe: Problem Refreshing Screen Pin
popo8419-Apr-05 21:48
popo8419-Apr-05 21:48 
GeneralRe: Problem Refreshing Screen Pin
ThatsAlok19-Apr-05 22:05
ThatsAlok19-Apr-05 22:05 
GeneralRe: Problem Refreshing Screen Pin
popo8420-Apr-05 3:48
popo8420-Apr-05 3:48 
GeneralRe: Problem Refreshing Screen Pin
popo8420-Apr-05 6:05
popo8420-Apr-05 6:05 
GeneralRe: Problem Refreshing Screen Pin
ThatsAlok20-Apr-05 20:07
ThatsAlok20-Apr-05 20:07 
GeneralRe: Problem Refreshing Screen Pin
popo8420-Apr-05 21:03
popo8420-Apr-05 21:03 
GeneralI need some much needed help, LOL! Pin
Atptour19-Apr-05 16:40
Atptour19-Apr-05 16:40 
I just started learning how to use C++ and I have a program problem. I thought that I completed the program correctly, but it keeps saying that I have errors, and I don't know why. Below I have what the program is about and my code.

About the program: AG Enterprises has sales outlets in 5 different regions numbered from 1 to 5. Write a program that calculates and displays the total amount sold in each region. Use a counter-controlled while loop to count the regions. Use a nested while loop to allow the user to enter the sales for a given region. Output the total sales for the region as soon as the inner loop stops.

My code:
#include <iostream>

using std::cout;
using std::endl;

int main()
{
double sales = 0.0;
double totRegSales = 0.0;

for (int region = 1; region < 6; region = region + 1)
{
cout << "First sales amount for Region" << region << ":";
cin >> sales;

do
{
totRegSales = totRegSales + sales;

cout << "Second sales amount for Region" << region << ":";
cin >> sales;

} while (sales > 0);

do
{
totRegSales = totRegSales + sales;

cout << "Third sales amount for Region" << region << ":";
cin >> sales;

} while (sales > 0);

do
{
totRegSales = totRegSales + sales;

cout << "Fourth sales amount for Region" << region << ":";
cin >> sales;

} while (sales > 0);

do
{
totRegSales = totRegSales + sales;

cout << "Fifth sales amount for Region" << region << ":";
cin >> sales;

} while (sales > 0);

cout << "Region " << region << "sales: " << totRegSales <
GeneralRe: I need some much needed help, LOL! Pin
Christian Graus19-Apr-05 17:45
protectorChristian Graus19-Apr-05 17:45 
GeneralRe: I need some much needed help, LOL! Pin
Atptour20-Apr-05 1:58
Atptour20-Apr-05 1:58 
GeneralRe: I need some much needed help, LOL! Pin
Christian Graus20-Apr-05 13:02
protectorChristian Graus20-Apr-05 13:02 
GeneralRe: I need some much needed help, LOL! Pin
David Crow20-Apr-05 2:14
David Crow20-Apr-05 2:14 
GeneralRe: I need some much needed help, LOL! Pin
FlyingTinman20-Apr-05 8:49
FlyingTinman20-Apr-05 8:49 
GeneralSetFocus() causes infinite loop Pin
elephantstar19-Apr-05 12:32
elephantstar19-Apr-05 12:32 
GeneralRe: SetFocus() causes infinite loop Pin
James R. Twine20-Apr-05 8:10
James R. Twine20-Apr-05 8:10 
GeneralSetting audio &quot;default device&quot; Pin
wilsonian19-Apr-05 11:46
wilsonian19-Apr-05 11:46 
GeneralRemebering the position of a dialog box Pin
itsh1119-Apr-05 11:09
itsh1119-Apr-05 11:09 
GeneralRe: Remebering the position of a dialog box Pin
Ravi Bhavnani19-Apr-05 12:09
professionalRavi Bhavnani19-Apr-05 12:09 
GeneralExchange variables betweeen CPPs. Pin
Anonymous19-Apr-05 10:35
Anonymous19-Apr-05 10:35 
GeneralRe: Exchange variables betweeen CPPs. Pin
ThatsAlok20-Apr-05 0:30
ThatsAlok20-Apr-05 0:30 
GeneralADO Database connect with MS acces Pin
Member 166386919-Apr-05 10:33
Member 166386919-Apr-05 10:33 
GeneralC++ Builder/ Client Server Pin
brilliant10119-Apr-05 10:14
brilliant10119-Apr-05 10:14 
GeneralIE Proxy Switcher Deskband Pin
Matthew Devine19-Apr-05 9:56
Matthew Devine19-Apr-05 9:56 
GeneralRe: IE Proxy Switcher Deskband Pin
Gerald Schwab19-Apr-05 10:26
Gerald Schwab19-Apr-05 10:26 
GeneralRe: IE Proxy Switcher Deskband Pin
Matthew Devine20-Apr-05 10:32
Matthew Devine20-Apr-05 10:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.