Can you check my program for me?

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

31 Replies - 1794 Views - Last Post: 19 January 2010 - 09:34 PM Rate Topic: -----

#1 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Can you check my program for me?

Post icon  Posted 19 January 2010 - 08:12 PM

It's a program that will calculate the someone's monthly payment...i just can't seem to find whats wrong with it

//displays month's pay

#using <mscorlib.dll>
using namespace System;

//function prototypedouble calcPayment(int, double, int);

int main()
{
	double salary = 0.0;
	double overtime = 0.0;
	double hoursWorked = 0.0;
	double totalEarned = 0.0;
	
	//enter input items
	Console::Write("Enter name of employee: ");
	Console::Write("Enter salary: ");
	salary = Convert::ToDouble(Console::ReadLine());
	Console::Write("Enter overtime: ");
	overtime = Convert::ToDouble(Console::ReadLine());
	Console::Write("Enter hours worked: ");
	hoursWorked = Convert::ToDouble(Console::ReadLine());

	//calculate 
	totalEarned = hoursWorked * salary * overtime;

	//display month's pay
	Console::WriteLine("Total Pay: {0}",Convert::ToString(totalEarned));
	
	return 0;
}	//end of main function


can someone fix it for me plz? it's for a school project...

the errors im having are...it doesn't work for one and i can't figure out why...when ever i try to build it just says failure and not a reason why...then when i try to start without debugging which we were taught to do in my class like i said my teacher doesn't teach he just handed us the manual and told us to read it

This post has been edited by Lordloyd2: 19 January 2010 - 08:30 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Can you check my program for me?

#2 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:19 PM

You need to read the #1 statement this site pounds into all newbees... they will not do your homework.
You should come here armed with a specific question about something YOU are working on.
Was This Post Helpful? 0
  • +
  • -

#3 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:23 PM

im not asking for you to do my homework...i just need some guidance with this my teacher doesn't teach us well so i only have a manual from 2002 to work with...I'm completely lost with it, and i am working on this, this is all code i wrote from scratch

This post has been edited by Lordloyd2: 19 January 2010 - 08:24 PM

Was This Post Helpful? 0
  • +
  • -

#4 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3202
  • View blog
  • Posts: 19,234
  • Joined: 14-September 07

Re: Can you check my program for me?

Posted 19 January 2010 - 08:25 PM

Quote

Describe any errors you are encountering. Help us help you!

Was This Post Helpful? 0
  • +
  • -

#5 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:32 PM

Sorry I'm not here to judge... I only joined this site a few days ago...
Anyway since it is clear that you need help bad I can at least get you started.
What compiler are you using?
Was This Post Helpful? 0
  • +
  • -

#6 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:34 PM

microsoft visual studio but im using 2010 beta right now the computers that i need it to work on have the 2002 version thus the reason i have a manual from 2002
Was This Post Helpful? 0
  • +
  • -

#7 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:37 PM

View PostLordloyd2, on 19 Jan, 2010 - 07:34 PM, said:

microsoft visual studio but im using 2010 beta right now the computers that i need it to work on have the 2002 version thus the reason i have a manual from 2002

OK... you need to stick with a command line program. So follow these instructions...
File/New/Project
Select Win32 console application... give it a name and then click OK... then just click Finish...
Let me know when you have that going...
Was This Post Helpful? 0
  • +
  • -

#8 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:39 PM

View Postsonicpp, on 19 Jan, 2010 - 07:37 PM, said:

View PostLordloyd2, on 19 Jan, 2010 - 07:34 PM, said:

microsoft visual studio but im using 2010 beta right now the computers that i need it to work on have the 2002 version thus the reason i have a manual from 2002

OK... you need to stick with a command line program. So follow these instructions...
File/New/Project
Select Win32 console application... give it a name and then click OK... then just click Finish...
Let me know when you have that going...


O.O im sorry you lost me where do i enter this at
Was This Post Helpful? 0
  • +
  • -

#9 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:44 PM

View PostLordloyd2, on 19 Jan, 2010 - 07:39 PM, said:

View Postsonicpp, on 19 Jan, 2010 - 07:37 PM, said:

View PostLordloyd2, on 19 Jan, 2010 - 07:34 PM, said:

microsoft visual studio but im using 2010 beta right now the computers that i need it to work on have the 2002 version thus the reason i have a manual from 2002

OK... you need to stick with a command line program. So follow these instructions...
File/New/Project
Select Win32 console application... give it a name and then click OK... then just click Finish...
Let me know when you have that going...


O.O im sorry you lost me where do i enter this at

The "File" word is in the top left hand side of Visual Studio... press that then "New"... that will lead to "Project"

Please hurry I have to go to bed soon.
Was This Post Helpful? 0
  • +
  • -

#10 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:44 PM

okay what should i put it as empty project?
Was This Post Helpful? 0
  • +
  • -

#11 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:46 PM

View PostLordloyd2, on 19 Jan, 2010 - 07:44 PM, said:

okay what should i put it as empty project?

Just select Win32 console and then OK... then Finish

You should now see something like this...
// tubbb.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}


Was This Post Helpful? 0
  • +
  • -

#12 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:47 PM

k im there
Was This Post Helpful? 0
  • +
  • -

#13 sonicpp   User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 58
  • Joined: 08-January 10

Re: Can you check my program for me?

Posted 19 January 2010 - 08:49 PM

View PostLordloyd2, on 19 Jan, 2010 - 07:47 PM, said:

k im there

Good now do this
Select "Debug"/"Start without debuggin"
You should get a console pop up with Press any key to continue...
Do this step to insure everything is OK up to this point.
Was This Post Helpful? 0
  • +
  • -

#14 Lordloyd2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-December 09

Re: Can you check my program for me?

Posted 19 January 2010 - 08:52 PM

k i got the press any key to continue message
Was This Post Helpful? 0
  • +
  • -

#15 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6715
  • View blog
  • Posts: 31,112
  • Joined: 10-May 07

Re: Can you check my program for me?

Posted 19 January 2010 - 08:52 PM

Press any key :)

I prefer shift myself. You know, just to see what's gonna happen. Maybe it'll work... maybe not!
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3