Thanks in advance.....
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- int main ()
- {
- const float TAXRATE = 0.06;
- float totalCost, total_discount, taxDue, amountDue;
- float cost;
- float num_items;
- float discountRate;
- totalCost = num_items * cost;
- total_discount = totalCost - discountRate * totalCost;
- taxDue = total_discount * TAXRATE;
- amountDue = total_discount + taxDue;
- cout<<"Please enter the Cost of all Items: \n";
- cin >> cost;
- cout<<"Please enter the Numbr of Items: \n";
- cin >> num_items;
- cout<<"Please enter the Discounted Rate: \n";
- cin >> discountRate;
- cout<<"The Total Cost is: "<<totalCost<<" .\n";
- cout<<"The Tax Due: "<<taxDue<<" .\n";
- cout<<"The Amount Due: "<<amountDue<<" \n";
- return 0;
- }
1>Deleting intermediate and output files for project 'Q10p175', configuration 'Debug|Win32'
1>Compiling...
1>Q10p175.cpp
1>c:\documents and settings\dj000034880\desktop\computer science\lab assignment 2\q10p175\q10p175\q10p175.cpp(8) : warning C4305: 'initializing' : truncation from 'double' to 'const float'
1>c:\documents and settings\dj000034880\desktop\computer science\lab assignment 2\q10p175\q10p175\q10p175.cpp(14) : warning C4700: uninitialized local variable 'num_items' used
1>c:\documents and settings\dj000034880\desktop\computer science\lab assignment 2\q10p175\q10p175\q10p175.cpp(14) : warning C4700: uninitialized local variable 'cost' used
1>c:\documents and settings\dj000034880\desktop\computer science\lab assignment 2\q10p175\q10p175\q10p175.cpp(15) : warning C4700: uninitialized local variable 'discountRate' used
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>LINK : C:\Documents and Settings\dj000034880\Desktop\Computer Science\Lab Assignment 2\Q10p175\Debug\Q10p175.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Documents and Settings\dj000034880\Desktop\Computer Science\Lab Assignment 2\Q10p175\Q10p175\Debug\BuildLog.htm"
1>Q10p175 - 0 error(s), 4 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========