![]() |
Alas, I am but a grasshopper with it comes to C++ and was wondering if you C++ gurus could help me out. I am not asking for you to write the code for me but just give some guidance, resources, hints, possible problems, etc. Here is the assignment:
Assignment: In general, your C++ program will create an SQL script file. When the script file is executed (by using the START OUTPUT.SQL command in Oracle), this script will create a new table in the database and add data into the table. The name of the table and the names for the table's fields will be specified by the user. The data that will be added to this table will come from the CUSTOMER.TXT file. * Your program should begin by asking the user to enter the name for a new database table. * Your program should then ask the user to enter seven names to use for seven fields that will be created in the table. * Next, your program should create an output text file called OUTPUT.SQL * In the output file, your program should write the SQL command necessary to remove a table from the database. The table's name was specified by the user in step one above. * In the output file, your program should write the command(s) necessary to create a new table. The table's name was specified by the user in step one above. The table will contain seven fields and the names of the fields were specified by the user in step two above. The first six fields will hold character data and the seventh field will hold numeric data. You will need to examine the data in the CUSTOMER.TXT file to determine the specific properties of these fields such as: variable or fixed length character fields size limits on the fields integer or floating point number field which one is the best choice for primary key Note that each field in the CUSTOMER.TXT file is separated with a comma. * Next, your program should begin reading data from the CUSTOMER.TXT file. For every line found in the customer file, your program should write into the output file, an SQL statement used to insert data into the newly created table. For example, you will read the first line of data in the CUSTOMER.TXT file; this line contains seven pieces of data separated by commas. You should write, into the output file, an SQL statement which will add these seven pieces of data as a new record in the table. Your program would then read the second line in the CUSTOMER.TXT file and write an SQL statement which will add these seven pieces of data as a second new record in the table. Note that the current file contains 10 records, but your program should not rely on that. My test file may contain any number of records, including the possibility of zero records. Also note, if you find two commas beside each other in the input file, this indicates a NULL data value for that particular field. * Finally, your program should write into the output file the SQL command necessary to save the changes that your script file makes to the database. You should test the output from your program to make sure that it is a WORKING script file. You can do this by logging into Oracle and then using the START command to have Oracle load and execute your script file. Here is what the Customer.txt files looks like: 10010,Ramas,Alfred,A,615,844-2573,0.00 10011,Dunne,Leona,K,713,894-1238,0.00 10012,Smith,Kathy,W,615,894-2285,345.86 10013,Olowski,Paul,F,615,894-2180,536.75 10014,Orlando,Myron,,615,222-1672,0.00 10015,O'Brian,Amy,B,713,442-3381,0.00 10016,Brown,James,G,615,297-1228,221.19 10017,Williams,George,,615,290-2556,768.93 10018,Farriss,Anne,G,713,382-7185,216.55 10019,Smith,Olette,K,615,297-3809,0.00 Thank you for sharing your wisdom. |
You mention C#, yet the assignment is in C++ and the thread is in the C++ forum...
So I assume you want it in C++... :
|
I'm not sure if that was very helpful but I will thank you for being the only one who responded to my inquiry.
|
It wasn't intended to be helpful - it was to tell you to do it yourself. If you have a specific problem, by all means, post it, but no one on here will do your homework for you. Well, unless you feel like shipping some Oreos over to the UK, that is...
|
You know you canbuy Oreos over here :)
|
I know he said he is new, but you should at least be able to tell the difference between C++ and C# especially if you are actually using it. Could be wrong I have not used C# yet, but most of the time when you open a microsoft product it shows a splash screen with the program name ;P. Could be wrong.
What exactly was the question anyways? |
The question was can you please do my homework for me beacuse i havent studied and need to stop selling cocaine...
|
I am not asking for you to write the code for me but just give some guidance, resources, hints, possible problems, etc.
I was just asking where to get started. I would have hoped this forum would have been more mature than the others and not have elitists that only pick on the newbies guess I was wrong. |
I doubt that they where picking on you. We just get alot of people coming here and asking us to do their homework for them. Have you attempted the code yet? If so, post what you have and then we'll give useful input back. The reason why some many Newbies think that people are beating up on them is because they don't try anything before posting, try out some code then post. All of us here have jobs, school, etc...so we can't write your code for you.
|
Thank you for the useful post Pizentios, I do have some code written but I have a job too. That is why I took alot of offense to the comments; becoming a programmer takes alot of time and effort and when you aren't living on campus and having to pay all your bills and go to college it is tough to concentrate on scholastics. It is not that I am selling cocaine! I am actually at work right now so I do not have my code with me, but when I get home I will show you what I have.
|
| All times are GMT -5. The time now is 3:05 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC