![]() |
|
#1
|
|||
|
|||
Day of week Functional decompostionOk I am doing an assignment for school. Here is what I have to do.
Use functional decomposition to write a C++ program that takes a number in the range of 0 to 6 and a second number in the range of 1 to 366 as input. The first number represents the day of the week on which the year begins, where 0 is Sunday, and so on. The second number indicates the day of the year. The program outputs the name of the day of the week corresponding to the day of the year. The number of the day of the week can by computed as follows: (startday + day of year - 1) %7 The program should output an error message if the numbers entered are not in the required ranges. The prompt adn the error message should make it clear to the user how the numbers must be entered. Be sure to use proper formatting and appropriate comments in your code. The output should be labeled clearly and formatted neatly. Ok I have come up with some of the code for this. The code works but I am not sure if the proper data is being output. Also I have an error message coded but I don't know if I have it right and it really isn't doing what I want it to do. Here is my code so far: CPP / C++ / C Code:
Last edited by LuciWiz : 30-Sep-2006 at 11:05.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Day of week Functional decompostionFirst, please format your code so we can read it and enclose it in [ c++ ] and [ /c++ ] (without the spaces) tags. Then, read the Guidelines. Ask yourself these questions:
1. Does the code compile? Yes: go to #2 No: show us the code (you did that) and copy and paste the exact error messages. 2. Does the program crash? Yes: tell us what you input, and what output up until the crash. No: go to #3 3. What did you expect the program to do? 4. What does the program do? 5. Is there a difference between the answers to #3 and #4? Yes: tell us the input and output, and what you don't understand about said difference. No: well, why are you here then? |
|
#3
|
|||
|
|||
Re: Day of week Functional decompostionWell I don't gues I will be posting here anymore because I am not too sure how much more specific I can get without drawing a picture. Smart *** comment's are not appreciated. Have a nice day. Thanks for the help in which I recieved none.
|
|
#4
|
||||
|
||||
Re: Day of week Functional decompostionSo draw a picture.
It's really hard to help someone when they don't post accurate information, and in a way it can be read -- then when we ask for clarification we're the smart*** for explaining what we need to understand your problem. You claim Quote:
Quote:
[smart*** comment] "Hi mechanic, my car starts, and it runs, but I don't think it runs right. And when I turn the wheel, I'm not sure if it's doing the right thing..." With this info, could you fix the car? [/smart*** comment] That's a smart*** comment... __________________
Definition: Politics Latin, from poly meaning many and tics meaning blood sucking parasites -- Tom Smothers |
Recent GIDBlog
Enable Compression for SSH by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NFL Preview, Regular Season Week 2 | john1981cr | Sports Forum | 0 | 13-Sep-2006 11:41 |
| Figuring out the day of the week | Darth Predator | C++ Forum | 13 | 31-Jul-2006 17:20 |
| Return month by providing work week | shinyhui | C++ Forum | 7 | 22-Feb-2005 07:23 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The