Write a program that allows the user to enter any number of names; i.e – last name and first name. Using one of the predefined methods of the Array class, order the names in ascending order. Display the results.
Write a program that allows the user to enter any number of names; i.e – last name and first name. Using one of the predefined methods of the Array class, order the names in ascending order. Display the results.
double radius;
double height;
double ans;
Console.WriteLine("what is the radius ");
radius = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("what is the height ");
height = Convert.ToDouble(Console.ReadLine());
ans = radius * radius * 3.14 * height ;
Console.WriteLine("your volume is " + ans );
}
}
// Method: CalculateNet
// Parameters
// grossP: double storing the grossPay
// tax: double storing tax percentage to be removed from gross pay
// netP: call by reference double storing the computed net pay
// Returns: void
public static void CalculateNet(double grossP, double tax, ref double netP)
{
// *** Insert the details of the CalculateNet Method
}
Question is to Insert the details of the CalculateNet Method
// Call a method to calculate the gross pay (call by value)
grossPay = CalculateGross(hrsWrked, ratePay);
// Invoke a method to calculate the net pay (call by reference)
CalculateNet(grossPay, taxRate , ref netPay);
// print out the results
Console.WriteLine("{0} worked {1} hours at {2:C} per hour", lastName,
hrsWrked, ratePay);
// *** Insert the code to print out the Gross Pay and Net Pay
Console.ReadLine();
}
// Method: CalculateGross
// Parameters
// hours: integer storing the number of hours of work
// rate: double storing the hourly rate
// Returns: double storing the computed gross pay
public static double CalculateGross(int hours, double rate)
{
// *** Insert the contents of the CalculateGross Method
}
1.Question is to insert the code to print out the Gross Pay and Net Pay.
2.Insert the contents of CalculateGross Method.
using System;
public static class Lab6
{
public static void Main()
{
// declare variables
int hrsWrked;
double ratePay, taxRate, grossPay, netPay=0;
string lastName;
// enter the employee's last name
Console.Write("Enter the last name of the employee => ");
lastName = Console.ReadLine();
// enter (and validate) the number of hours worked (positive number)
do
{
Console.Write("Enter the number of hours worked (> 0) => ");
hrsWrked = Convert.ToInt32(Console.ReadLine());
} while (hrsWrked < 0);
// enter (and validate) the hourly rate of pay (positive number)
// *** Insert the code to enter and validate the ratePay
// enter (and validate) the percentage of tax (between 0 and 1)
// *** Insert the code to enter and validate taxRate
question is to insert the code to enter and validate ratePay and taxPay
Write a C# program that calculates the total sales amount of a company agent. In the main method, prompt the user to enter the agent’s name, the number of the units sold by the agent, the cost per unit and the discount percent offered (like 0.1 or 0.2).
A method CalculateSales takes the number of units and the unit cost. The method calculates the total amount of sales by multiplying the number of units times the cost.
Another method CalculateNetSales takes the total amount of sales (calculated in the CalculateSales ) and the discount percent, then it calculates the net sales amount by multiplying the total amount by discount percent then subtracting the total amount of sales from the result of the multiplication.
The main method prints out the agent’s name, the number of units sold and the net sales amount. (You must use placeholders and the currency code inside your print statement).
Develop the program with a Graphical User Interface using C# to compute for the Total Account Value of the 401(k) upon retirement.
Example output
Annual Salary ($): 35000
Annual Salary Increase (%):2.5
Annual Rate of Return (%):7.4
Current Age:32
Age of Retirement:61
Current 401k Balance ($):2000
Contribution to 401k (%):8
Employer Match (%):25
Employer Max Contribution (%):5
Total Account Value: $346891.95
Create a menu to calculate the area and perimeter of different figures
a)Triangle e)Oval
b)Trapezium f)Hexagon
c)Circle g)Pentagon
d))Cone h)Decagon
Create a Midi Parent form
Progress bar/Slash Screen