Draw a flowchart, write an algorithm and design a C++ program for a store owner who wants to give 10% discount to the purchases made by customers who are at least 65 years old. Use the selection structure.
How to print triple slash in codechum
The area of a triangle whose sides a, b, and c can be computed by the formula:
π¨πππ ππ π»πππππππ = βπ ((π β π)(π β π)(π β π))
where S = (a+b+c)/2. On the other hand, the hypotenuse of a right triangle can be computed using the
formula:
3. π»π¦πππ‘πππ’π π = βπ
2 + π
2 .
Write a program that can compute for the Area of a Triangle and the Hypotenuse of a right triangle. Your
program must allow the user to choose what computation to take first. Only one computation at a time. Use
a function for each computation. Allow the user to repeat the entire process as often as he/she wants
2. The area of a triangle whose sides a, b, and c can be computed by the formula:
π¨πππ ππ π»πππππππ = βπ ((π β π)(π β π)(π β π))
The area of a triangle whose sides a, b, and c can be computed by the formula:
π¨πππ ππ π»πππππππ = βπ ((π β π)(π β π)(π β π))
where S = (a+b+c)/2. On the other hand, the hypotenuse of a right triangle can be computed using the
formula:
One (1) euro is equivalent to fifty five (55) pesos and one (1) dollar is equivalent to 44 pesos. Write a program
that converts dollar to euro. The program should ask the user to input an amount in dollar and display the
equivalent amount in euro. Use a function for the conversion. Allow the user to repeat as often as the user
wants.
A
method
addWin()
,
which
takes
no
arguments
and
increments
the
number
of
times
the
player has won.
β’
A
toString()
method,
which
takes
no
arguments
and
returns
(as
a
String
)
the
playerβs
name, followed by the number of points in parentheses.
For example, if the playerβs name
is
Jeff
and the player has 25 points, youβll return
"Jeff (25 points)"
.
note
that the auto-
grader is vary particular about the formatting of your return String here.
Getters
for
the
name
(
String
),
number
of
points
(
int
),
and
number
of
wins
(
int
).
These
should be called
getName()
,
getScore()
, and
getWins()
, respectively.
β’
A method
addPoints()
, which takes in an
int
and adds that number to the total number of
points the user has.
β’
A method
resetScore()
, which takes no arguments and resets the playerβs score to zero.
A constructor which takes in a
String
, the playerβs name.
If the
String
given is
null
or the
empty string (
""
), set the playerβs name to a
unique
non-empty value (in my reference code,
I use βPlayer 1β, βPlayer 2β, etc).
Otherwise, set the name to the given
String
.
Score and
number of wins should both start at zero.
A constructor which takes no arguments. It sets the name to a
unique
non-empty string. (In
my reference code, I use βPlayer 1β, βPlayer 2β, etc).
Create a struct Boat include the length, name and how many nights the boat will be in the marina.
Ask the user for the length of the boat, the name of the boat and how many nights they will be staying.Β Store the info in a vector of boats but do not allow more than 20 boats because that is the capacity of the marina.Β Allow the user to print out all the boats that are 40 feet or above.Β Write a menu so the user can continue until they wish to quit.