473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Newspaper vendor homework assignement

4
hi... i just wondering could anyone write an program (in C++) because i have an Assignment to do in c++ and i dont really have a clue what to do Plz help Me ill send you a copy of assignment !!!

__________________________________________________ ________________
Project brief.

(a) A newspaper vendor wants to calculate his daily income. You must write a program to input the number of papers he sells each day and the price he sells them at. he pays VAT at 21% and each paper costs him 50 + 20 cent delivery.

(b)Expand this program to input the number of papers he buys and the number he sells. He returns the papers he does not sell, but he must still pay the delivery charge on them.

Project should contain:

Pseudocode for (a) above
Test Data
Code

Pseudocode for (b) above
Test Data
Code..


__________________________________________________ ________________

can anyone help me PLZ!

thx...
Dec 8 '06 #1
7 2304
hi... i just wondering could anyone write an program (in C++) because i have an Assignment to do in c++ and i dont really have a clue what to do Plz help Me ill send you a copy of assignment !!!

__________________________________________________ ________________
Project brief.

(a) A newspaper vendor wants to calculate his daily income. You must write a program to input the number of papers he sells each day and the price he sells them at. he pays VAT at 21% and each paper costs him 50 + 20 cent delivery.

(b)Expand this program to input the number of papers he buys and the number he sells. He returns the papers he does not sell, but he must still pay the delivery charge on them.

Project should contain:

Pseudocode for (a) above
Test Data
Code

Pseudocode for (b) above
Test Data
Code..


__________________________________________________ ________________

can anyone help me PLZ!

thx...

hi there,

actually there are so many people here who can help you, but pls try to post something so you've got the benifit also ok, many peolple here can type your code actually, but i do'nt think we can easily post something because it takes more time, so post something, coz that would be a great help>>>>


regards,
Dec 8 '06 #2
cisco
4
hi there,

actually there are so many people here who can help you, but pls try to post something so you've got the benifit also ok, many peolple here can type your code actually, but i do'nt think we can easily post something because it takes more time, so post something, coz that would be a great help>>>>


regards,

yes i will try
thx
Dec 8 '06 #3
cisco
4
well first of all we have just finished" While_do" excersise and that it ive done _ if and elses,,,, whiles,,,, variables.. but still i dont know what to do i' have started a little bit just the basic
Dec 11 '06 #4
sonic
40
What is VAT?
Dec 11 '06 #5
nickyeng
254 100+
your program should be easy even if you're not a c++ programmer.

what i have to deeply learn about c++ is templates, header files(as interface class file in java), etc.

Your program (a) involves only calculation. In here you dont have to learn much about C++ language except those available variables type.

Hope you get a post of your code, and then people here will help you for sure.
Dec 11 '06 #6
sonic
40
Here's the code you were wanting to know about. For future reference it is better if you have a question to at least post the code you have tried as nickyeng said in his last post. This forum is a wonderful resource, but only if you're willing to try and learn yourself. I myself am new to C++ and have always found that members of this forum will help as long as you're giving an honest effort. Good luck with the rest of your classes. The program should work fine with the exception of the VAT calculation. I'll let you figure that bit out.

Expand|Select|Wrap|Line Numbers
  1.  
  2. // Newspaper.cpp
  3. // For help on thescripts forum - program calculates profit on 
  4. // daily sales of newspapers
  5.  
  6. #include <iostream>
  7. #include <iomanip>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.  
  14.     int numBought = 0;
  15.     int numSold = 0;
  16.     int leftPapers = 0;
  17.     double price = 0;
  18.     double grossProfit = 0;
  19.     double deductions = 0;
  20.     double credits = 0;
  21.     double netProfit = 0;
  22.  
  23.     cout << "Number of newpapers bought for day? ";
  24.     cin >> numBought;
  25.     cout << "What is vendor charging per newspaper?  $";
  26.     cin >> price;
  27.     cout << "How many newspapers were sold for the day? ";
  28.     cin >> numSold;
  29.  
  30.     leftPapers = numBought - numSold;
  31.     grossProfit = numSold * price;
  32.     deductions = numBought * .70;
  33.     credits = leftPapers * .50;
  34.     netProfit = (grossProfit + credits) - deductions;
  35.  
  36.     // somewhere in here needs to be calculation for 21% VAT
  37.  
  38.     system("cls");
  39.  
  40.     cout << "\n\n";
  41.     cout << "\t\tDaily Profits for the day\n";
  42.     cout << "\t\t-------------------------\n";
  43.     cout << "\t\tPapers bought:\t" << numBought << "\n";
  44.     cout << "\t\tPapers Sold:\t" << numSold << "\n\n";
  45.     cout << fixed << showpoint << setprecision(2);
  46.     cout << "\t\tNet Profit:\t$" << netProfit << "\n\n";
  47.  
  48.  
  49.  
  50.  
  51.     return 0;
  52. }
  53.  
  54.  
Dec 11 '06 #7
cisco
4
thanks for the code its nearly works just have to fix some errors ( whats this means --system("cls") anyways i think i know how to type in (*vat at 21.% symply use 0.21 as for the number and add to the function..!

tell me wat you think!?!

Dec 18 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Brandons of mass destruction | last post by:
Ok, I work for a small newspaper thats looking to translate our content to the web. XML sounds like a good way to do this, but i'm a little confused. Is it possible to have <b> and <i> tags in...
16
by: yuraukar | last post by:
I am trying to create a garbage collection class in C++ to collect instances of a specific class (so no general gc). The approach is to use smart pointers and a mark and a simple sweep gc. ...
11
by: :o) | last post by:
Does anyone know a (better) way to automatically adjust "newspape style" columns to window-resize? See old discussion o stylesheets-forum:...
3
by: sushant | last post by:
hi all, whats the difference between assignement and initialisation in C. is assignement related with scanf() and initialisation with (int x=10;) sushant
4
by: VB Programmer | last post by:
I have an ASPX page that I'm creating. It'll have alot of text. I want the text to be 2 columns, like a newspaper. If the user resizes the browser the columns should adjust accordingly. What...
17
by: Alexander Eisenhuth | last post by:
Hello, is there a assignement operator, that i can overwrite? class MyInt: def __init__(self, val): assert(isinstance(val, int)) self._val = val a = MyInt(10)
2
by: Mufasa | last post by:
I have a list of items that I'd like to have wrap like columns in a newspaper. So that as I add items, it would be in two columns and things would wrap appropriately. So if there were 11 items, it...
5
by: Adam Smith | last post by:
Hello, Several of the newer, more professional web sites are using a newspaper columnar layout, with text and links discretely contained in rectangular boxes (square or rounded), frequently with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.