| | |
repetitive work
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2008
Posts: 4
Reputation:
Solved Threads: 0
1,hi i need to create a program that will repeat the following 14 times.it needs to provide keyboard input that takes in hours worked in a day.after the 14 time it needs to show the hours worked.
2,the rate of pay is 6 pounds 50 pence. it needs to provide the gross pay on screen for those two weeks.
3,it needs to provide their gross pay for one year assuming they get the same every two weeks.
4,it needs to provide the yearly net pay taking off 20% tax & 5% national insurance
if anyone can help me out with this i would be very gratefull, i am a total beginner and this is for the course i am on and am really struggling#cheers john
this is where i'm at lots of errors can't work it out
2,the rate of pay is 6 pounds 50 pence. it needs to provide the gross pay on screen for those two weeks.
3,it needs to provide their gross pay for one year assuming they get the same every two weeks.
4,it needs to provide the yearly net pay taking off 20% tax & 5% national insurance
if anyone can help me out with this i would be very gratefull, i am a total beginner and this is for the course i am on and am really struggling#cheers john
C++ Syntax (Toggle Plain Text)
#include "stdafx.h" #include "iostream" using namespace std; int main(void) float fTotal=0; float fHoursworked=0; float fPay=6.5; float cYear=26; cout <<"please enter the your hours worked today\n"; for (int idays = 0);idays;<14;idays;+=1) } cin >> fHoursworked; fTotal += fHoursworked; cout <<"the total number of hours worked is"<<fTotal<<"\n"; fTotal = fTotal*fPay; cout <<"the total number of hours worked is"<<fTotal<<"\n"; fTotal= fTotal* cYear; cout<<"the total number of hours worked is"<<cYear<<"\n"; return 0;
Last edited by Ancient Dragon; Oct 13th, 2008 at 9:28 am. Reason: add code tags
Work through the error messages one at a time. The first error is normally what's wrong. Correct that error then recompile -- you will get a lot fewer error messages that way.
For example: line #2 of the code you posted is probably wrong. System header files are enclosed in < and > brackets, not quotes.
line 12: you have an extraneous ; just before the += operator
line 13: you used the wrong brace -- should be { instead of }, and your program is missing the matching }
For example: line #2 of the code you posted is probably wrong. System header files are enclosed in < and > brackets, not quotes.
#include <iostream> line 12: you have an extraneous ; just before the += operator
line 13: you used the wrong brace -- should be { instead of }, and your program is missing the matching }
C++ Syntax (Toggle Plain Text)
for (int idays = 0);idays;<14;idays +=1) { cin >> fHoursworked; fTotal += fHoursworked; }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Primary Drive 0 Not Found (Troubleshooting Dead Machines)
- Projects for the Beginner (Python)
- Tutorial: Understanding ASP classes (ASP)
- HotKeys as optimisation tool (Windows Software)
- Trying to set up a wireless network (Networking Hardware Configuration)
- Computers perpetial restarting (Windows NT / 2000 / XP)
- procedure and object-oriented ! (C)
- a few search engine optimization questions (Search Engine Optimization)
Other Threads in the C++ Forum
- Previous Thread: how can we sort data from text file
- Next Thread: Logic Question
Views: 328 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






