new beginner to C++

I am new to C++ and I need help doing my assigments.
I know that it is gona seem so much but I really like C++ and I am really working on my self to learn so please don't push me back ;-))

So I knw the basics in writting programs and I need the fillings
I don't know how to write these programs
1) Shipping charge is $5 plus a dollar per item. Ask the user how many items, then tell the user the total shipping charge

2)Health Insurance Premium is $500.00 plus $100.00 per dependent. User tells you how many dependents, you tell what the premium will be.

And the teacher put us this link for the insurance:
http://www.netquote.com/nq/savings_general2.aspx?nqid=12633&status=TL_insurance

3) Gross Pay is $20.00 per hour up to 40 hours, 1½× after 40 hours. User tells you how many hours worked, you compute gross pay. (Extra Credit, Requires an if statement.

4) Write a simple Quadratic Equation program for 1 point.

5) Exercise the MessageBox() function. Show three MessageBoxes with different combinations of messages, captions, buttons and icons.

6)Design a Form that uses several textboxes. Show that it moves data back and forth using a Textbox control: Provide sufficient functionality to demonstrate the program has communication in both directions with the Screen.

and I will work on them, thanks
1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>

using namespace std;

int main(void)
{
     const int charge=5;
     const int priceitem=1;
     int items=0;

     cout<<"how many items to you take with you?"<<endl;
     cin>>items;
   
     cout<<"the charge is "<<charge+priceitem*items<<" dollar."<<endl;
     return 0;
}


2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;

int main(void)
{
        const long prebase = 500000;
        const long predepend=100000;
        int dependent=0;
        cout<<"enter the number of dependents"<<endl;
        cin>>dependent;
        cout<<"the premium is "<<prebase+predepend*dependent<<" dollar."<<endl;
        return 0;
}

Chck the following site for help:

www.cprogramming.com

Chck the following site for help:

www.cprogramming.com


Awesome site!
oooo ok, thanks

And what about the other 4 couldn't do them .... am soory I tried but no soultion and am still reading through the book
3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>

int main()
{
   double hours = 0;
   const double rate = 20.00; 
   double pay = 0;

   std::cout << "How many hours have you worked: ";
   std::cin >> hours;
   // do error checking here
  
   if(hours >40) {
       hours %= 40;
       pay = (hours * (rate*1.5)) + (40 * rate)
   }
   else 
       pay = hours * rate;

   std::cout << "You have earned " << pay;

   std::cin.get();
   return 0;
}


These first 3/4 are very easy programs that you shouldn't really be struggling with. If you are, it means you haven't done enough work and need to read more before you start writing your own programs. Otherwise, you will just end up annoying yourself.
Topic archived. No new replies allowed.