Jump to content
Sign in to follow this  
Paxman

who's good at C++?

Recommended Posts

»Paxman    4776

I have an assignment due in 2 weeks and I don't know how to do. It's first year c++ (the class is called programming fundamentals so it shouldn't be hard if you know your shit). Can someone let me know they can do c++ so you can help me?

Share this post


Link to post
Share on other sites
Dr.P    0

The real question is, have you ever done any programming before?

Basically if you've had any experience, C++ is easy to pick up. And it's pretty much the back-bone of a lot of modern languages.

Is this a High School or a College/Uni course?

Share this post


Link to post
Share on other sites
»Paxman    4776
The real question is, have you ever done any programming before?

Basically if you've had any experience, C++ is easy to pick up. And it's pretty much the back-bone of a lot of modern languages.

Is this a High School or a College/Uni course?

Uni course. It's beginner programming but my teacher is way behind on teaching my class shit. It's the 2nd last week of the semester and he just taught my class arrays. =/

No, until this course I had 0 experience.

Share this post


Link to post
Share on other sites
Dr.P    0

Okay, well I never bothered to take much for Uni programming....but go ahead and post what you need to do (and some of the specific requirements) and I'll see if I can offer any advice/help.

Share this post


Link to post
Share on other sites
BiPi    1032

JUST taught you all arrays? that's lousy as fuck. they introduced arrays to us within the second week and even then it felt kinda slow.

there are so many resources on the interwabs. use them and g'luck.

Share this post


Link to post
Share on other sites
»Paxman    4776
JUST taught you all arrays? that's lousy as fuck. they introduced arrays to us within the second week and even then it felt kinda slow.

there are so many resources on the interwabs. use them and g'luck.

I know right.

Well here's what I have to do in case someone wants to offer some help. This might be hella easy... but Programming isn't my major so I don't know/care about it.

You are required to design a program post.cpp (point of sale terminal) that will be used to calculate the total cost for a list of purchased items against a list of product prices. Each purchased item will be presented by its productId, the price per item, and the corresponding quantity. The program is expected to be interactive and the user can enter everything line by line and generate such as an invoice at the end. We note that such an application usage can be alternatively illustrated by piping all the data to the program. Suppose all the program control commands and the data for the products and purchased items are stored in a plain text file datafile.txt in the form similar to the following sample

/rawprices

P010001 24.99

QX-35 19.99

DVD-player5 58.95

P010002 8.85

P010003 35.00

/items

P010001 2

DVD-player5 1

P010002 20

/invoice

/quit

where in a typical data line (blank lines are ignored), the first column represents the product ID which will be alphanumeric without white spaces, the second column represents the product price in Australian dollars when inputing product prices, and will represent the quantity of the corresponding purchased item when inputing purchased items. Your program post.exe compiled from post.cpp will then be able to generate an invoice via

post.exe < datafile.txt > invoice.txt

whose output invoice.txt could look like

PHANTOM COMPANY INVOICE

PRODUCT ID QUANTITY PRICE ($) COST ($)

P010001 2 24.99 49.98

DVD-player5 1 58.95 58.95

P010002 20 8.85 177.00

...

TOTAL COST = $xxxxx.xx

When the post program is executed, it will process commands and data records entered by the user. If a word read into the program starts with the character "/", possibly when the programming is attempting to read in a product ID, then the word is deemed a program command. This program should support at least the following commands

* /rawprices: this indicates that the data records to follow, if any, will be for the product pricing in the form of

productId price

* /items: this indicates that the data records to follow, if any, will be for the purchased items in the form of

productId quantity

* /invoice: this generates the invoice on the purchased items already read into the program

* /quit: this terminates the program

and any other words that start with the character '/' will be considered an invalid command. For the convenience and uniformity of the program design, we assume that the total number of different products will not exceed 2000, and the total number of purchased items for each invoice will not exceed 1000.

The program should be designed in such a way that piping can also be used to properly generate an invoice output as in the example at the beginning of this document. Any explicit use of file inside the C++ program for this part will not be considered a proper or complete solution in this particular assessment. We note that if you are using prompts for interactive data input, you need to make sure that the prompts are sent to standard error device using cerr (instead of cout), i.e. using cerr in place of cout. This way, the prompts will not be piped into the output file, say, statement.txt.

For the solution of this part, the students are required to provide

* the defining diagram (IPO chart) - 2 marks

* the structure chart (hierarchy chart) - 2 marks

* solution algorithm in pseudocode (don't use the C++ constructs: no break, no return statements for instance) - 2 marks

* complete program in C++ (including naming, style etc) - 3 marks

* proposed testing cases with expected results for checking - 1 mark

* desk checking a typical case - 1 mark

* general design quality, error reporting, feel and robustness - 1 mark

NOTE: For this part, students may assume that the data records are line based, as described in Part-II below, if they so wish. For the pseudocode part, students may assume that all data that are fed to the program will be in correct format. For the C++ program, however, some kind of additional error reporting is required.

Share this post


Link to post
Share on other sites
»MaLiK23    16

its not that hard tbh. any simple C book, let alone C++ will sort you out.

Share this post


Link to post
Share on other sites
»Paxman    4776
its not that hard tbh. any simple C book, let alone C++ will sort you out.

Really? Because I have one and I don't even know where to start.

Share this post


Link to post
Share on other sites
»MaLiK23    16
its not that hard tbh. any simple C book, let alone C++ will sort you out.

Really? Because I have one and I don't even know where to start.

When is it due in?

I know the feeling, my uni professor just gave us some tutorials and told us to spend a term doing them. I had to get ash to teach me the day before my exam lol!

What program and compiler are u supposed to use? Do you need to build a GUI?

I have moved away from programming completely in my engineering course so i cant be of ALOT of help im afraid.

Good luck.

Share this post


Link to post
Share on other sites
»Paxman    4776
its not that hard tbh. any simple C book, let alone C++ will sort you out.

Really? Because I have one and I don't even know where to start.

When is it due in?

I know the feeling, my uni professor just gave us some tutorials and told us to spend a term doing them. I had to get ash to teach me the day before my exam lol!

What program and compiler are u supposed to use? Do you need to build a GUI?

I have moved away from programming completely in my engineering course so i cant be of ALOT of help im afraid.

Good luck.

Next friday.

Dev-C++ is my compiler.

I don't need a gui or anything... it's just using piping to read off a text file and building an invoice. But I don't know shit lol

Share this post


Link to post
Share on other sites
Legares    1

I've been in this sort of dilemma with programming before. My best advice would be to take things slow. Read over your book and use the internet very carefully to try and understand the terminology used, and try to think logically about the problems presented.

Don't ever take an answer from someone without realizing how they thought it through though, because programming courses will just murder you otherwise. I would say more than any other subject this requires full understanding.

Share this post


Link to post
Share on other sites
its not that hard tbh. any simple C book, let alone C++ will sort you out.

Really? Because I have one and I don't even know where to start.

Page One is usually a good spot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×