[Log In ] [New Posts] []
Go Back   GotApex? Forums Forums > General Topics > Software, OS, and the Internet
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-10-2002, 11:30 PM   #1
hang10wannabe
Captain
 
hang10wannabe's Avatar
 
Join Date: Jul 2002
Location: OxnardiA
Posts: 1,884
Send a message via AIM to hang10wannabe
Unhappy comp 106 code... 7 errors??? whah???

heres the code... it gives me 7 errors saying that my "else" statements dont have matching "if" statments... but they do!!! dammit all... i have an hour and a half b4 its due!!!!

#include <iostream>
using namespace std;

int main ()
{

int mondayHour, tuesdayHour, wednesdayHour, thursdayHour, fridayHour, weekdayHour, saturdayHour, sundayHour, totalHour;

double payRate, mondayPay, tuesdayPay, wednesdayPay, thursdayPay, fridayPay, saturdayPay, sundayPay, totalPay, saturdayMinute, weekdayMinute, sundayMinute, mondayMinute, tuesdayMinute, wednesdayMinute, thursdayMinute,
fridayMinute, weekTotal, bonus, weekPay;

cout << "input value for Pay Rate: \n";
cin >> payRate;

// input minutes and hours

cout << "input number of hours worked on Monday: \n";
cin >> mondayHour;
cout << "input number of minutes worked on Monday: \n";
cin >> mondayMinute;

double mondayTotal = mondayHour + mondayMinute / 60;

if (mondayTotal > 8);
{
mondayPay = (8 * payRate) + (mondayTotal - 8) * (payRate * 1.5);
}
else
{
mondayPay = (mondayTotal * payRate);
}

cout << "input number of hours worked on Tuesday: \n";
cin >> tuesdayHour;
cout << "input number of minutes worked on Tuesday: \n";
cin >> tuesdayMinute;

double tuesdayTotal = tuesdayHour + tuesdayMinute / 60;

if (tuesdayTotal > 8);
{
tuesdayPay = (8 * payRate) + (tuesdayTotal - 8) * (payRate * 1.5);
}
else
{
tuesdayPay = (tuesdayTotal * payRate);
}

cout << "input number of hours worked on Wednesday: \n";
cin >> wednesdayHour;
cout << "input number of minutes worked on Wednesday: \n";
cin >> wednesdayMinute;

double wednesdayTotal = wednesdayHour + wednesdayMinute / 60;

if (wednesdayTotal > 8);
{
wednesdayPay = (8 * payRate) + (wednesdayTotal - 8) * (payRate * 1.5);
}
else
{
wednesdayPay = (wednesdayTotal * payRate);
}


cout << "input number of hours worked on Thursday: \n";
cin >> thursdayHour;
cout << "input numbr of minutes worked on Thursday: \n";
cin >> thursdayMinute;

double thursdayTotal = thursdayHour + thursdayMinute / 60;

if (thursdayTotal > 8);
{
thursdayPay = (8 * payRate) + (thursdayTotal - 8) * (payRate * 1.5);
}
else
{
thursdayPay = (thursdayTotal * payRate);
}


cout << "input number of hours worked on Friday: \n";
cin >> fridayHour;
cout << "input number of minutes worked on Friday: \n";
cin >> fridayMinute;

double fridayTotal = fridayHour + fridayMinute / 60;

if (fridayTotal > 8)
{
fridayPay = (8 * payRate) + (fridayTotal - 8) * (payRate * 1.5);
}
else
{
fridayPay = (fridayTotal * payRate);
}

cout << "input number of hours worked on Saturday: \n";
cin >> saturdayHour;
cout << "input numbr of minutes worked on Saturday: \n";
cin >> saturdayMinute;

double saturdayTotal = saturdayHour + saturdayMinute / 60;

if (saturdayTotal > 8);
{
saturdayPay = (8 * payRate) + (saturdayTotal - 8) * (payRate * 1.5);
}
else
{
saturdayPay = (saturdayTotal * payRate);
}


cout << "input number of hours worked on Sunday: \n";
cin >> sundayHour;
cout << "input numbr of minutes worked on Sunday: \n";
cin >> sundayMinute;

double sundayTotal = sundayHour + sundayMinute / 60;

if (sundayTotal > 8);
{
sundayPay = (8 * payRate) + (sundayTotal - 8) * (payRate * 1.5);
}
else
{
sundayPay = (sundayTotal * payRate);
}

// if statement for Total Hours

weekTotal = mondayTotal + tuesdayTotal + wednesdayTotal + thursdayTotal + fridayTotal + saturdayTotal + sundayTotal;

weekPay = mondayPay + tuesdayPay + wednesdayPay + thursdayPay + fridayPay + saturdayPay + sundayPay;

if (weekTotal > 60);
{
bonus = (60 - weekTotal) * (payRate / 2);

totalPay = weekPay + bonus;
}
else
{
totalPay = weekPay;
}


cout << totalPay <<"\n";


return EXIT_SUCCESS;
}
hang10wannabe is offline   Reply With Quote
Old 10-10-2002, 11:32 PM   #2
sho.gun
the lemonizer
 
sho.gun's Avatar
 
Join Date: Apr 2001
Location: Calabasas, CA
Posts: 5,373
Send a message via AIM to sho.gun
the ; after the ifs, take em out...

lol Simmons TYPE-R
sho.gun is offline   Reply With Quote
Old 10-10-2002, 11:52 PM   #3
hang10wannabe
Captain
 
hang10wannabe's Avatar
 
Join Date: Jul 2002
Location: OxnardiA
Posts: 1,884
Send a message via AIM to hang10wannabe
UPDATED CODE

#include <iostream>
using namespace std;

int main ()
{

int mondayHour, tuesdayHour, wednesdayHour, thursdayHour, fridayHour, saturdayHour, sundayHour;

double payRate, mondayPay, tuesdayPay, wednesdayPay, thursdayPay, fridayPay, saturdayPay, sundayPay, totalPay, saturdayMinute, sundayMinute, mondayMinute, tuesdayMinute, wednesdayMinute, thursdayMinute,
fridayMinute, weekTotal, bonus, weekPay;

cout << "input value for Pay Rate: \n";
cin >> payRate;

// input minutes and hours

cout << "input number of hours worked on Monday: \n";
cin >> mondayHour;
cout << "input number of minutes worked on Monday: \n";
cin >> mondayMinute;

double mondayTotal = mondayHour + mondayMinute / 60;

if (mondayTotal > 8)
{
mondayPay = (8 * payRate) + (mondayTotal - 8) * (payRate * 1.5);
}
else
{
mondayPay = (mondayTotal * payRate);
}

cout << "input number of hours worked on Tuesday: \n";
cin >> tuesdayHour;
cout << "input number of minutes worked on Tuesday: \n";
cin >> tuesdayMinute;

double tuesdayTotal = tuesdayHour + tuesdayMinute / 60;

if (tuesdayTotal > 8)
{
tuesdayPay = (8 * payRate) + (tuesdayTotal - 8) * (payRate * 1.5);
}
else
{
tuesdayPay = (tuesdayTotal * payRate);
}

cout << "input number of hours worked on Wednesday: \n";
cin >> wednesdayHour;
cout << "input number of minutes worked on Wednesday: \n";
cin >> wednesdayMinute;

double wednesdayTotal = wednesdayHour + wednesdayMinute / 60;

if (wednesdayTotal > 8)
{
wednesdayPay = (8 * payRate) + (wednesdayTotal - 8) * (payRate * 1.5);
}
else
{
wednesdayPay = (wednesdayTotal * payRate);
}


cout << "input number of hours worked on Thursday: \n";
cin >> thursdayHour;
cout << "input numbr of minutes worked on Thursday: \n";
cin >> thursdayMinute;

double thursdayTotal = thursdayHour + thursdayMinute / 60;

if (thursdayTotal > 8)
{
thursdayPay = (8 * payRate) + (thursdayTotal - 8) * (payRate * 1.5);
}
else
{
thursdayPay = (thursdayTotal * payRate);
}


cout << "input number of hours worked on Friday: \n";
cin >> fridayHour;
cout << "input number of minutes worked on Friday: \n";
cin >> fridayMinute;

double fridayTotal = fridayHour + fridayMinute / 60;

if (fridayTotal > 8)
{
fridayPay = (8 * payRate) + (fridayTotal - 8) * (payRate * 1.5);
}
else
{
fridayPay = (fridayTotal * payRate);
}

cout << "input number of hours worked on Saturday: \n";
cin >> saturdayHour;
cout << "input numbr of minutes worked on Saturday: \n";
cin >> saturdayMinute;

double saturdayTotal = saturdayHour + saturdayMinute / 60;

if (saturdayTotal > 8)
{
saturdayPay = (8 * payRate) + (saturdayTotal - 8) * (payRate * 2.25);
}
else
{
saturdayPay = (saturdayTotal * (payRate * 1.5));
}


cout << "input number of hours worked on Sunday: \n";
cin >> sundayHour;
cout << "input numbr of minutes worked on Sunday: \n";
cin >> sundayMinute;

double sundayTotal = sundayHour + sundayMinute / 60;

if (sundayTotal > 8)
{
sundayPay = (8 * payRate) + (sundayTotal - 8) * (payRate * 3);
}
else
{
sundayPay = (sundayTotal * (payRate * 2));
}

// if statement for Total Hours

weekTotal = mondayTotal + tuesdayTotal + wednesdayTotal + thursdayTotal + fridayTotal + saturdayTotal + sundayTotal;

weekPay = mondayPay + tuesdayPay + wednesdayPay + thursdayPay + fridayPay + saturdayPay + sundayPay;

if (weekTotal > 60)
{
bonus = (60 - weekTotal) * (payRate / 2);

totalPay = weekPay + bonus;
}
else
{
totalPay = weekPay;
}


cout << totalPay <<"\n";


return EXIT_SUCCESS;
}
hang10wannabe is offline   Reply With Quote
Old 10-11-2002, 12:00 AM   #4
sleepminded
Lieutenant Commander
 
sleepminded's Avatar
 
Join Date: Jul 2001
Location: in a straight jacket, tied up in a padded cell
Posts: 968
Send a message via AIM to sleepminded
what do u want it to do??? my friends might be able to help a bit
__________________
m00...ph34r t3h n00b

[-=1manclan=-]n00b
sleepminded is offline   Reply With Quote
Old 10-11-2002, 12:16 AM   #5
hang10wannabe
Captain
 
hang10wannabe's Avatar
 
Join Date: Jul 2002
Location: OxnardiA
Posts: 1,884
Send a message via AIM to hang10wannabe
Quote:
Originally posted by sleepminded
what do u want it to do??? my friends might be able to help a bit

well its supposed to take several variables dealing with payrates and hours worked and compile how much a person should get paid for their hours and minutes worked... and the main reason im posting it is so i can sho sho.gun ... if u buds have any input maybe itll help
hang10wannabe is offline   Reply With Quote
Old 10-11-2002, 12:20 AM   #6
sleepminded
Lieutenant Commander
 
sleepminded's Avatar
 
Join Date: Jul 2001
Location: in a straight jacket, tied up in a padded cell
Posts: 968
Send a message via AIM to sleepminded
i confused my buddies ^^"
sleepminded is offline   Reply With Quote
Old 10-11-2002, 12:32 AM   #7
hang10wannabe
Captain
 
hang10wannabe's Avatar
 
Join Date: Jul 2002
Location: OxnardiA
Posts: 1,884
Send a message via AIM to hang10wannabe
Quote:
Originally posted by sleepminded
i confused my buddies ^^"

ahh dont worry dudeski... i found all the bugs with sho.guns help... and i emailed my submission file with half an hour to spare... good times
hang10wannabe is offline   Reply With Quote
Old 10-11-2002, 12:37 AM   #8
hapoo
Fleet Admiral
 
hapoo's Avatar
 
Join Date: Jan 2000
Location: 742 Evergreen Terrace, Springfield USA
Posts: 9,276
where are you taking this class hang10? Is this a c++ class?
__________________
hapoo is offline   Reply With Quote
Old 10-11-2002, 01:16 AM   #9
Cheesypuff
Vice Admiral
 
Cheesypuff's Avatar
 
Join Date: Dec 2000
Location: Cali, but missing Hong Kong and Texas
Posts: 4,782
Send a message via AIM to Cheesypuff Send a message via MSN to Cheesypuff Send a message via Yahoo to Cheesypuff
this sort of looks like java.

But hey...I could be really wrong.

Anywho Hang10...are you asking us to Cheat?

Because if you are...I have no idea what to do. And if you arn't. I still have no idea what the heezies this is!
__________________
Life is like toilet paper, long and useful!
The stars at night, are big and bright *clap 4x* deep in the heart of TEXAS!
Cheesypuff is offline   Reply With Quote
Old 10-11-2002, 03:38 AM   #10
hapoo
Fleet Admiral
 
hapoo's Avatar
 
Join Date: Jan 2000
Location: 742 Evergreen Terrace, Springfield USA
Posts: 9,276
Quote:
Originally posted by Cheesypuff
this sort of looks like java.

But hey...I could be really wrong.

Anywho Hang10...are you asking us to Cheat?

Because if you are...I have no idea what to do. And if you arn't. I still have no idea what the heezies this is!



i've never really programmed in java but i don't think you'd use #include <iostream> and using namespace std; in java. I just found it strange how they're teaching him programming in c++ but there isn't a single object in his code.
hapoo is offline   Reply With Quote
Old 10-11-2002, 06:18 AM   #11
ribitch
Rear Admiral Upper Half
 
ribitch's Avatar
 
Join Date: Sep 2001
Location: Michigan
Posts: 3,672
Send a message via AIM to ribitch
the main program block is similar in java to c, but vary different. By looking at this block one can determine what language it is.

java:
public static void main(String args[])

c/c++:
int main ()
__________________
http://ribitch.com/ipod.html
ribitch is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 04:20 PM.