I am new to programming and I am having problems doing this. Can anyone pm me the solution to this? I want to compare mine to another persons. Thanks.
"Develop an algorithm that will determine the gross pay of a particular employee. You need to read the hourly rate, and the amount of hours worked by the employee. You should display the hours, hourly rate, and gross pay of the employee. If the hours worked exceed 40 compute the overtime will be paid 1.5 *hourly rate."
1. Please, always use Code tags while posting code snippets. See Announcement: Before you post....
2. Your code cannot be compiled. What are hours, rate, hrsworked , overtime, overtimerate, Grosspay2, hourlyrate, grosspay2? Where and how are they defined?
Sorry guys, it's just I'm really new to this stuff. My teacher literally handed me this book called "C Primer Plus 5th edition" and told me to this assignment. I am so clueless. Any advice is appreciated. Where to start? Am I even on the right track? Help!?!?
Can anyone at least help me on where/how I should start this?
Code:
int main()
{
// fill this in
}
Honestly I am not even sure where to start.....what I posted before is just a bunch of random things that really don't make much sense to me.
So what do you want us to do? I'll give you a test:
Write a C++ "Hello World" program.
If you can't do this properly, then it's futile asking for help with this problem you're having. From what you've written, you shouldn't be able to write a proper "Hello World" C++ program, since there are so many basic beginner errors in the code you posted.
I suggest you read your book from chapter 1 until you understand everything in chapter 1.
So what do you want us to do? I'll give you a test:
Write a C++ "Hello World" program.
If you can't do this properly, then it's futile asking for help with this problem you're having. From what you've written, you shouldn't be able to write a proper "Hello World" C++ program, since there are so many basic beginner errors in the code you posted.
I suggest you read your book from chapter 1 until you understand everything in chapter 1.
No. This is not a correct C++ "Hello World" program.
Code:
Thank you for testing your code with Comeau C/C++!
Tell others about http://www.comeaucomputing.com/tryitout !
Your Comeau C/C++ test results are as follows:
Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ C++0x_extensions
"ComeauTest.c", line 4: error: return type "int" omitted in declaration of function
"main", so use int main() OR int main(int argc, char *argv[])
main(){
^
1 error detected in the compilation of "ComeauTest.c".
In strict mode, with -tused, Compile failed
The following is a correct C++ "Hello World" program:
Code:
#include <iostream>
int main()
{
std::cout << "Hello World";
}
See the difference?
Also, are you coding in 'C' or C++. If it's 'C' please say so.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; February 15th, 2009 at 09:48 PM.
At the very least, list the compiler errors. The first error is obvious, as my last post shows. Also, please use code tags when posting code. See how the code I post is formatted nicely, and yours is ragged? The magic of code tags makes the code readable.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; February 15th, 2009 at 09:47 PM.
Bookmarks