Maybe this world is another planet's Hell.
- Aldous Huxley
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Shipping Charge
by: bs0d
Description:
This Visual C++ program uses the switch() case to determine shipping charge based on a state code entered by user.
Code:
//Displays a shipping charge # include
using namespace std; int main() { //declare my variables int stateCode = 0; //gather input data cout << "Enter the state code: "; cin >> stateCode; //determine state code entered and display shipping charge. switch(stateCode) { case 1: cout << "Shipping Charge is $25" << endl; break; case 2: case 5: case 6: cout << "Shipping Charge is $30" << endl; break; case 3: case 4: cout << "Shipping Charge is $40" << endl; break; default: cout << "Error: Incorrect State Code" << endl; } return 0; } // end of main function.
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
10,281
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
Open and Write System Call
·
Bit Multiplication
·
Hello World
·
Gross Pay
·
Fat Percentage
·
Commission
"AllSyntax.com" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy