Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 2nd, 2005, 08:00 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default C Programming

Hello...

I am in a C programming class and this is my second time taking the course. C programming is foreign to me. I am better at a user friendly program like Visual Basic. Everytime I try to complete my homework assignments I just find myself sitting there staring at each page. I have a homework assignment with two questions due that I just can't figure out how exactly to start or what my program should consist of. HELP PLEASE!

#1. As a programmer for Emrics Groceries, you are contracted to write an interactive program in C/C++ which will ask for the transaction year, user's name entering the data and will request from the user total monthly sales for each month through the year. The output will be the total sales per quarter, average quarterly sales, total annual sales and average annual sales.

#2. As a wage employee write a program to ask for your hours worked during each day of the week and your pay rate. Print out the hours worked, the rate and your gross pay for each day of the week. Also print out your highest gross total and least gross total and the days of the week these totals were earned. Also print the total gross salary for the week and the average.

Shalice L. Holt
Reply With Quote
  #2 (permalink)  
Old September 18th, 2005, 03:08 AM
Authorized User
 
Join Date: Mar 2005
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Alan-LB Send a message via Yahoo to Alan-LB
Default

Please let us know the name of your lecturer and we can send your completed homework directly to them when we have done it for you. We will also accept your degree in Computer Science on your behalf. :)

You will never become a programmer if you try to get other people to do your homework for you. No one is here to do your homework for you and you should not expect us to.

Get yourself a good beginner's textbook (your class teacher should be able to advise you) and work your way through it slowly and methodically. At least make some attempt at code and see how far you can get. When you get stuck post your code and any error messages here, then we will have something to advise you on. Show us that you are making some sort of attempt.

Good luck!!

Alan.


Reply With Quote
  #3 (permalink)  
Old March 23rd, 2006, 02:41 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is my questions:
Write an interactive program for a grocery store which will ask for the transaction year, user's name entering the data and will request from the user total monthly sales for each month through the year. The output will be the total sales per quarter, average quarterly sales, total annual sales and average annual sales.

What am I doing wrong

#include <iostream.h>


int main ( )
{

    int transYear, userName, num;
    double month1,month2,month3,month4,month5,month6,month7,m onth8,month9,month10,month11,month12;
    double qrt1, qrt2, qrt3, qrt4, qrtAvg, annlSales, annlAvg;

    qrtAvg = (qrt1+qrt2+qrt3+qrt4)/4;
    annlSales = (month1+month2+month3+month4+month5+month6+month7+ month8+month9+month10+month11+month12);
    annlAvg = (month1+month2+month3+month4+month5+month6+month7+ month8+month9+month10+month11+month12)/12;

    cout << "Enter transaction year: \n" ;
    cin >> transYear;
    cout << "Enter user name: \n";
    cin >> userName;

    cout << "Enter montly sales separated by space: ";
    cout << endl;
    cin >> month1>> month2>> month3>> month4>> month5>> month6>> month7>> month8>> month9>> month10>> month11>> month12;

    cout << "Sales per quarter are: \n" << qrt1 << "\n"<< qrt2 <<"\n"<< qrt3 <<"\n"<< qrt4;
    cout << endl;
    cout << "Average quarterly sales are: \n" << qrtAvg;
    cout << endl;
    cout << "Total annual sales are: \n" << annlSales;


return 0;

}

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
device DLL programming in client side programming hendyhanusin ASP.NET 1.0 and 1.1 Professional 2 February 19th, 2009 12:01 PM
device DLL programming in client side programming hendyhanusin ASP.NET 1.0 and 1.1 Basics 0 March 21st, 2007 08:05 AM
device DLL programming in client side programming hendyhanusin ASP.NET 2.0 Professional 1 March 21st, 2007 08:04 AM
Help Programming Ryujin84107 Intro Programming 2 March 1st, 2007 09:55 AM
Qt programming, bugs in first programming sateeshgalla BOOK Beginning Linux Programming, 3rd Edition 0 October 14th, 2005 08:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.