Documente Academic
Documente Profesional
Documente Cultură
******************************************************************/
Step
3:
Visual
Studio
users:
After
your
program
is
running
properly,
use
the
<CTRL><F5>
command
one
more
time.
Drag
the
command
screen
(output)
to
a
place
on
the
desktop
where
both
the
code
(at
least
some
of
it)
and
the
output
can
be
seen.
NetBeans
users:
After
your
program
is
running
properly,
run
it
one
more
time.
Try
to
arrange
your
screen
so
I
can
see
both
the
code
and
the
command
window.
Step
4:
Do
a
screen
capture
using
the
Print
Screen
function.
This
will
be
your
proof
that
it
ran
correctly.
Step
5:
Create
a
Word
doc
with
the
following
items:
Pseudocode
Screen shot of the output window and at least some of the editor window visible
Heres
an
example
of
how
it
might
look:
Pseudocode:
Prompt and input month, year, and total collected
sales = total/1.06
countyTax = sales*.02
stateTax = sales*.04
totalTax = countyTax+stateTax
output total, sales, countyTax, stateTax, and totalTax
Program
Code:
/******************************************************************
Billie
Williams
Lesson
3
Programming
Assignment
#1,
Page
144,
Number
14
The
function
of
this
program
is
to
calculate
Monthly
Sales
Tax
based
on
total
monies
collected.
Input
=
month,
year,
and
total
collected
Output
=
total,
sales,
countyTax,
stateTax,
and
totalTax
******************************************************************/
#include
<iostream>
#include
<iomanip>
using
namespace
std;
int
main()
{
char
month[22],
year[7];
double
sales,
totalCollected,
countyTax,
stateTax,
totalTax;
//Input
section
cout
<<
"Input
Month
and
Year
separated
by
a
space:
"
<<
endl;
cin
>>
month
>>
year;
cout
<<
"Input
the
total
amount
collected
at
the
cash
register:
"
<<
endl;
cin
>>
totalCollected;
//calculate
sales
and
taxes
sales
=
totalCollected
/
1.06;
countyTax
=
sales
*
0.02;
stateTax
=
sales
*
0.04;
totalTax
=
countyTax
+
stateTax;
//output
report
cout
<<
setprecision(2)
<<
fixed;
cout<<endl<<endl;
cout
<<
"Month:
"
<<
month
<<
endl;
cout
<<
"Year:
"
<<
year
<<
endl;
cout
<<
"------------------------"
<<
endl;
cout
<<
"Total
Collected:
$
"
<<
setw(15)<<totalCollected
<<
endl;
cout
<<
"Sales:
$
"
<<
setw(15)
<<sales
<<
endl;
cout
<<
"County
Sales
Tax:
$
"
<<
setw(15)<<
countyTax
<<
endl;
cout
<<
"State
Sales
Tax:
$
"
<<
setw(15)
<<
stateTax
<<
endl;
cout
<<
"Total
Sales
Tax:
$
"
<<
setw(15)
<<
totalTax
<<
endl;
return
0;
}