Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help me with this problem i need it in C# only Convert the ProjectedRaises class to an interactive application named ProjectedRaisesInteractive. Instead of assigning values

help me with this problem i need it in C# only
Convert the ProjectedRaises class to an interactive application named ProjectedRaisesInteractive. Instead of assigning values to the salaries, accept them from the user as input.
Output for each employee should be formatted similar to the following example for the first employee: Next year's salary for the first employee will be $26,000.00.
Note: The salary in the output will change depending on the user input.
In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {0}", valu
using System;
using static System.Console;
using System.Collections.Generic;
//using system.Linq;
//using system.Text;
//using system.Threading.Task;
using System.Globalization;
class ProjectedRaisesInteractive
{
//class program
//{
static void Main(string[] args)
{
// Write your code here
const double RAISE=0.04;
double firstSalary=0, secondSalary=0, thirdSalary=0;
try
{
Write("Enter the salary for the first employee: ");
firstSalary = Convert.ToDouble(ReadLine());
Write("Enter the salary for the second employee: ");
secondSalary = Convert.ToDouble(ReadLine());
Write("Enter the salary for the third employee: ");
thirdSalary = Convert.ToDouble(ReadLine());
}
catch(Exception)
{
WriteLine("Please write in the correct format. ");
}
// Display next year's salary for each employee with currency formatting
WriteLine("Next year's salary for the first employee will be {0}",(firstSalary + firstSalary * RAISE).ToString("C"), CultureInfo.GetCultureInfo);
WriteLine("Next year's salary for the second employee will be {0}",(secondSalary + secondSalary * RAISE).ToString("C"), CultureInfo.GetCultureInfo);
WriteLine("Next year's salary for the third employee will be {0}",(thirdSalary + thirdSalary * RAISE).ToString("C"), CultureInfo.GetCultureInfo);
}
//}
}
using System;
using static System.Console;
using System.Globalization;
class ProjectedRaises
{
static void Main()
{
// Write your code here
const double RAISE =0.04;
double firstSalary =25000, secondSalary =38000, thirdSalary =51000;
WriteLine("Next year's salary for the first employee will be {0}",(firstSalary + firstSalary * RAISE).TOString("C"));
WriteLine("Next year's salary for the second employee will be {0}",(secondSalary + secondSalary * RAISE).ToString("C"));
WriteLine("Next year's salary for the third employee will be {0}",(thirdSalary + thirdSalary * RAISE).ToString("C"));
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

Are the rules readily available?

Answered: 1 week ago

Question

Prepare a short profile of Lucy Clifford ?

Answered: 1 week ago

Question

Prepare a short profile of Rosa parks?

Answered: 1 week ago

Question

Prepare a short profile of victor marie hugo ?

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago