Newspaper vendor homework assignement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cisco
    New Member
    • Dec 2006
    • 4

    Newspaper vendor homework assignement

    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...
  • thefarmer
    New Member
    • Nov 2006
    • 55

    #2
    Originally posted by cisco
    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,

    Comment

    • cisco
      New Member
      • Dec 2006
      • 4

      #3
      Originally posted by thefarmer
      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

      Comment

      • cisco
        New Member
        • Dec 2006
        • 4

        #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

        Comment

        • sonic
          New Member
          • Nov 2006
          • 40

          #5
          What is VAT?

          Comment

          • nickyeng
            Contributor
            • Nov 2006
            • 252

            #6
            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.

            Comment

            • sonic
              New Member
              • Nov 2006
              • 40

              #7
              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.

              Code:
              // Newspaper.cpp
              // For help on thescripts forum - program calculates profit on 
              // daily sales of newspapers
              
              #include <iostream>
              #include <iomanip>
              
              using namespace std;
              
              int main()
              {
              	
              	int numBought = 0;
              	int numSold = 0;
              	int leftPapers = 0;
              	double price = 0;
              	double grossProfit = 0;
              	double deductions = 0;
              	double credits = 0;
              	double netProfit = 0;
              
              	cout << "Number of newpapers bought for day? ";
              	cin >> numBought;
              	cout << "What is vendor charging per newspaper?  $";
              	cin >> price;
              	cout << "How many newspapers were sold for the day? ";
              	cin >> numSold;
              
              	leftPapers = numBought - numSold;
              	grossProfit = numSold * price;
              	deductions = numBought * .70;
              	credits = leftPapers * .50;
              	netProfit = (grossProfit + credits) - deductions;
              	
              	// somewhere in here needs to be calculation for 21% VAT
              
              	system("cls");
              
              	cout << "\n\n";
              	cout << "\t\tDaily Profits for the day\n";
              	cout << "\t\t-------------------------\n";
              	cout << "\t\tPapers bought:\t" << numBought << "\n";
              	cout << "\t\tPapers Sold:\t" << numSold << "\n\n";
              	cout << fixed << showpoint << setprecision(2);
              	cout << "\t\tNet Profit:\t$" << netProfit << "\n\n";
              
              
              
              
              	return 0;
              }

              Comment

              • cisco
                New Member
                • Dec 2006
                • 4

                #8
                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!?!

                Comment

                Working...