Question INSTRUCTIONS (Visual Basics) Write a program that prompts the user for
ID: 3669483 • Letter: Q
Question
Question
INSTRUCTIONS (Visual Basics)
Write a program that prompts the user for different pieces of information, performs various calculations, and displays the requested results on the screen as indicated by each set of instructions.
Problem #1
Ask the user for the radius of a circle and calculate the area and circumference of the circle. Display the results on the screen. Make sure you program can handle both integer and decimal inputs.
Use the following formula(s) to assist you in your calculations: Area = pi * radius2
Circumference = 2 * pi * radius
Problem #2
Ask the user for the base and height of a right triangle and calculate the area and perimeter of the triangle. Display the results on the screen. sure your program can handle both integer and decimal inputs.
Use the following formula(s) to assist you in your calculations: Area = (1/2) * base * height
Opposite_Side2 + Adjacent_Side2 = Hypotenuse2 (for right triangles)
Problem #3
Ask the user for a principle amount, interest rate, compound frequency (per year), and number of years and determine the amount of money that would exist in an account given the compound interest accumulation for the provided parameters. Display the results on the screen and make sure you program can handle both integer and decimal inputs.
Use the following formula(s) to assist you in your calculations:
Amount_In_Account = Principle * (1 + (Rate / Annual_Compound_Frequency))^(Annual_Compound_Frequency * Years_Elapsed)
Remember to round your figures to something reasonable. For questions 1 and 2, use 3 points of precision after the decimal points. For problem #3, use the currency formatting features of Console.Write() and Cosole.WriteLine() to display the results. Make your program output attractive.
THANK YOU
Explanation / Answer
1)
using System;
class CirclePerimeter
{
static void Main()
{
Console.WriteLine("Please write the radius of your circle and hit Enter afterwards: ");
double radius = double.Parse(Console.ReadLine());
double pi = Math.PI;
double area = 2 * pi * radius;
Console.WriteLine("The Perimeter or Circumference (C=2r) of your circle is: {0:F2}", area);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.