I will at least up the points to over 3k to award if someone can do both of thes
ID: 3549817 • Letter: I
Question
I will at least up the points to over 3k to award if someone can do both of these (they should be very simple). They're from a class I dropped last semester, and I've already done half of the assignments (though I did not save them). I'd just rather not go through it all again. I'll grant just what I have (maybe a few hundred more) if you can just answer one.
Exercise2-5:
Write a program that calculates and prints the take-home pay for a commissioned sales employee. Perform a compile-time initialization and store the name of Nesbith Lang in a variable called employeeName. Nesbith earns 7% of her total sales as her commission. Her federal tax rate is 18%. She contributes 10% to a retirement program and 6% to Social Security. Her sales this month were $161,432. Produce a formatted report showing the amount for each of the computed items. Select appropriate constants. After you finish displaying Nesbitch Lang's data, change the values and rerun and application.
Output should look like this - before the values are changed: http://imgur.com/Z87aom4
Exercise2-6:
Write a program that computes the average of five exam scores. Declare and perform a compile-time initialization with the five values. Use a constant to define the number of scores. Print all scores and the average value formatted with no digits to the right of the decimal. Rerun the application with different values.
Output should look like this - before the values are changed: http://imgur.com/9aNUZy1
Explanation / Answer
Humm :)
QUESTION 1 :
There's an inconsistency in the data here as it says in the question that Nesbith's commission is 7% but in the image it says that her gross pay is 9%. I've assumed the image figure is the correct one:
COMPILETIME ---------------------------------------------------------------------->>>>>>>>>>
RUNTIME ------------------------------------------------------------------------------------------>>>>>>
using System;
namespace countwords
{
class Gradingapp
{
static void Main()
{
int avg = 0; float navg = 0;
Console.WriteLine(" Grading App ");
Console.WriteLine();
Console.Write("Enters the list of scores needed :-");
int n = Convert.ToInt16(Console.ReadLine());
for ( int i = 1; i <= n; i++)
{
Console.Write("SCORE #" +i +" :- ");
avg += Convert.ToInt16(Console.ReadLine());
if (i == n)
{
navg = avg / n;
}
}
Console.WriteLine();
Console.WriteLine("Average :" + navg);
Console.WriteLine();
Console.WriteLine("Press any Key to continue ... ..");
Console.ReadKey();
}
}
}