Pages

Tuesday, October 8, 2013

Gross bill code in c++

Pizzarita Pizza House charges 10% Service 4% sales tax on the gross bill of its customers. Make a program that would input the gross bill of the customer and the amount given by the customer to the waiter. Program must output the customer's total bill and his charge.

This will be the output









Here's the code:

# include <iostream>
using namespace std;
int main ()
{
    float a=0, b=0;
    cout<<"Pizarita House"; cout<<endl;
    cout<<"Enter Gross Bill: "; cin>>a;
    cout<<"Service Tax: "; cout<<0.10<<endl;
    cout<<"Sales Tax: "; cout<<0.04<<endl;
    cout<<"Total Bill: "; cout<<a+(a*0.14); cout<<endl;
    cout<<"Amount Bill: "; cin>>b;
    cout<<"Change: "; cout<<b-(a+(a*0.14));
    cout<<endl;
    system ("pause");
}

That's all. Enjoy:)


Monday, October 7, 2013

Enter 3-digit code in c++

This will be the output:
Enter 3-digit: 123
First Digit: 1
Second Digit: 2
Last Digit: 3
The reverse value: 321

This is the code

# include <iostream>
using namespace std;
int main ()
{
int a=0, b=0, c=0, d=0;
cout<<"Enter 3-digit:"; cin>>d;
a=d/100;
b=(d-(a*100))/10;
c=d-((a*100)+(b*10));
cout<<endl;
cout<<"First Digit:"; cout<<a;
cout<<"Second Digit:"; cout<<b;
cout<<"Last Digit:"; cout<<c;
cout<<"The Reverse Value:"; cout<<c&&cout<<b&&cout<<a;
cout<<endl;
system ("pause");
}


Sunday, October 6, 2013

The Reverse Digit in c++

This is the 1st activity we did in our school. The Reverse Digit digit, you will input 3 integer and the output comes in reverse.

# include <iostream>
using namespace std;
int main ()
{
int x=0, y=0, z=0, a=0;
cout<<"Enter First Digit:"; cin>>x;
cout<<"Enter Second Digit:"; cin>>y;
cout<<"Enter Last Digit:"; cin>>z;
cout<<"The Reverse Value:" <<z<<y<<x;
cout<<endl;
system ("pause");
}

This is the output:
Enter First Digit:5
Enter Second Digit:4
Enter Last Digit:3
The Reverse Value: 345