Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise using different data - types Question 6 - 1 0 is due at the beginning of week 4 classes. ( Submission procedure will the
Exercise using different datatypes
Question is due at the beginning of week classes. Submission
procedure will the detailed in the lecture class
The objective of these exercises is to read and display the five native data types int double,
char, bool and string Please note that some of the problems might not have an intelligent
business purpose, but all that is necessary is to for you to read all of the five data type from user
input from the keyboard and display program output to the console.
You are reminded about the coding practices that
should be adhered to for this course regarding
solution name, project name, identifiers and also
pasting a copy of the problem at the top of your #
file.
You MUST use interpolated expression and where
necessary format specifier.
An interpolated string is a string literal that
might contain interpolated expressions ie
a value to be fetched or an expression to
be evaluated.
When an interpolated string is resolved to
a result string, items with interpolated
expressions are replaced by the string
representations of the expression results.
Write a program to ask the user about the validity of
a simple statement. The program should accept the
response then display the statement as well as the
response. The response should be true or false. For
this question, you must use a variable of type bool.
It is useful to know that Convert.ToBoolean can work with true, True, tRue, TRUE etc.
Write a program to calculate the area of a circle. The
user will enter the radius of the circle and the
program will calculate and display the area
according to the formula area radius
radius You must accept fractions as the input. If
the user enters for the radius then the area will be Use the formatspecifier for
floating point values
Write a program that prompts the user for a number
that may be a fraction The program reads in the
input and print the following: the input as a double,
the input as an int and finally the input as a char.
eg if the input is then the output will be and
Adult ticket cost $ and child ticket cost $ Write a program to prompt the user for the
amount of adult and child ticket that she needs. The program will display a userfriendly
message of the number of tickets brought as well as the total cost. Use the format
string for currency
Write a program to calculate and display the potential difference between the ends of a wire.
The program will prompt the user for the current flowing and the resistance of the wire.
Potential difference is the product of the current and the resistance of the wire and may
include a fractional part. Again use the formatspecifier for floating point values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started