| | |
PSP Help.
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2004
Posts: 3
Reputation:
Solved Threads: 0
Could some one help me with writing this code in C++. I'm taking a course called PSP, personal software process. The program i have to write is : store and retrieve a series of n real numbers into and from a file. On entry, the program should accept integer or real numbers and store them as real numbers. The user functions to be provided by this program are as follows: The user enters the file name. The user selects either the read or write mode. For read, the program displays the numbers in the file, one per line. For write, the user enters the quantity of numbers to be recorded followed by entry of all the numbers, one at a time. Do I need to write a class to do this? Do i use fstreams? I'm really inexperienced with coding. My place of business is making me take this course. I'd even pay someone(paypal) to help me write this code.
To help organize your thoughts, how about:
display a prompt to get the file name
read the filename from the console
display a prompt to get the mode (read/write)
read the mode from the console
if read-mode, open the file for read, while not eof, read the line, display it; when eof close the file.
if write-mode, open the file for write, get from the user the number of numbers to read, read each one and write it to the file, close the file.
Something like that. fstream would work, but so would fopen/fgets/fputs. no classes are needed, but maybe part of the assignment is to make a class to do some/all of this?
Good luck! Post some code if you get stuck.
display a prompt to get the file name
read the filename from the console
display a prompt to get the mode (read/write)
read the mode from the console
if read-mode, open the file for read, while not eof, read the line, display it; when eof close the file.
if write-mode, open the file for write, get from the user the number of numbers to read, read each one and write it to the file, close the file.
Something like that. fstream would work, but so would fopen/fgets/fputs. no classes are needed, but maybe part of the assignment is to make a class to do some/all of this?
Good luck! Post some code if you get stuck.
![]() |
Similar Threads
- what do you think to the psp (Geeks' Lounge)
- Connecting the Sony PSP to the Internet (Cellphones, PDAs and Handheld Devices)
Other Threads in the C++ Forum
- Previous Thread: Problem About Pointers
- Next Thread: Tool Needed
Views: 3018 | Replies: 5
| 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






. I'm very busy ( I own my own Software Development Company), just give me an email b*o*u*n*t*y*x*@*b*o*u*n*t*y*.*n*e*t (remove the stars)