![]() |
|
#1
|
|||
|
|||
Creating A Graph In CHi All Again
I have produced a program so far that creates an '*' for an equation thus code is below.. but now i wish too add x and y axis and numbers to the program any ideas i am really struggling. Question and My Answer So Far Below: QUESTION Write a program that displays the graph of the following equation Y=X+10 The program should first ask the user for: 1. the X axis starting point 2. the number of steps 3. step-size It should then repeatedly calculate the value of Y using the changing value of X. Normally, X increases by the step size for the number of steps specified. The program should display an ‘*’ in each X column to denote the Y value, e.g. if Y = 10, then the 10th element of an 81 element character array should be set to ‘*’ and then the string printed to the screen. All other elements should be a space character (“ “), except the last, which should be the null character to make it a string. If the value of Y goes over 80, then the program should put a ‘^’ hat character in the 79th (second to last) element of the array. If the value goes under 0 (zero), then the program should put a 0 (zero) in the 0 (first) element of the array. Add axis to the graph using a) ‘-‘ (minus) character for the Y axis b) ‘|’ (pipe) character for the X axis c) ‘+’ character in the lower left to show where they intersect at 0,0 Add numbers to the X and Y axis. The numbers on the X axis should be dictated by the user input. MY ANSWER SO FAR CPP / C++ / C Code:
|
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can I import another Lib while I am creating a static library in C++.Net? How? | george | MS Visual C++ / MFC Forum | 2 | 06-Jan-2005 16:07 |
| Help creating lists of pointers | The_Kingpin | C Programming Language | 0 | 11-Dec-2004 13:49 |
| Problem with the function creating updating a linked list | nkhambal | C Programming Language | 3 | 28-Oct-2004 20:45 |
| creating new file | Nelly | CPP / C++ Forum | 5 | 22-Apr-2004 02:35 |
| algorithm for display complex graph | ctai010 | CPP / C++ Forum | 0 | 20-Mar-2004 05:24 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The