Question

Please help. I need a C# program solution that will do the following: "Ask the user...

Please help. I need a C# program solution that will do the following:

"Ask the user to record the software developers' information in a C# data structure object record. The C# data structure object record must include the type of employee as either W2 or 1099 using the following requirements:

The 1099 software development employees' records do not include or calculate any taxes

The program properly handles and informs the user about errors on user input

The program demonstrates in the code the use of references types

The program displays on the console all the software developers' data, monthly pay, monthly taxes, annual gross pay, annual taxes, and net pay

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System;
                  
public class Software
{
   public static void Main()
   {
   int x;
   string s;
   Developer d=new Developer();
   Console.Write("Enter DeveloperID :: ");
   d.DevID =Convert.ToInt32(Console.ReadLine());
   Console.Write("Enter Developer Last Name :: ");
   d.Lname =Console.ReadLine();
   Console.Write("Enter Developer First Name :: ");
   d.Fname =Console.ReadLine();
   do
   {
   x=0;
   Console.WriteLine("Enter Developer Type (W2 or 1099):: ");
   s=Console.ReadLine();
   d.DevType =s;
   if(!d.DevType.Equals("W2")&&!d.DevType.Equals("1099"))
   {
   Console.Write("Error !! Enter Proper Developer Type as W2 or 1099)");
   x=1;
   }
   }while(x==1);
   Console.Write("Enter Monthly Salary :: ");
   d.Monthlypay =Convert.ToInt32(Console.ReadLine());
   if(d.DevType.Equals("W2"))
   {
   Console.Write("Enter monthly_taxes :: ");
   d.monthly_taxes =Convert.ToInt32(Console.ReadLine());
   }
   Developer d2=d; // use of references
   Console.WriteLine("Developer ID "+ d2.DevID);
   Console.WriteLine("Developer Name {0} {1}", d2.Lname, d2.Fname);
   Console.WriteLine("Developer Type "+ d2.DevType);
   Console.WriteLine("Developer Monthly Salary "+ d2.Monthlypay);
   if(d2.DevType.Equals("W2"))
   {
   Console.WriteLine("Developer Monthly Taxes "+ d2.monthly_taxes);
   Console.WriteLine("Developer Annual Gross Pay "+ (d2.Monthlypay*12));
   Console.WriteLine("Developer Annual Taxes "+ (d2.monthly_taxes*12));
   Console.WriteLine("Developer Annual Net Pay "+ (d2.Monthlypay*12-d2.monthly_taxes*12));
  
   }
   else
   {
   Console.WriteLine("Developer Annual Net Pay "+ (d2.Monthlypay*12));
   }
   }
}

struct Developer
{
   public int DevID;
   public string Lname;
   public string Fname;
   public string DevType;
   public long Monthlypay;
   public long monthly_taxes;
}

Output

Add a comment
Know the answer?
Add Answer to:
Please help. I need a C# program solution that will do the following: "Ask the user...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello I am confused about this C++ program. I need to create a payroll C++ program...

    Hello I am confused about this C++ program. I need to create a payroll C++ program following these steps. Source file structure Your program will consist of three source files: main.cpp the main program Payroll.hppclass declaration for the Payroll class. Make sure you have an include guard. Payroll.cpp Payroll's member functions Class definition Create a Payroll class definition. The class has private members which originate from user input: number of hours worked hourly rate float float - and private members...

  • need help please! thanks!! C++ programming Your program should do the following Prompt the user for...

    need help please! thanks!! C++ programming Your program should do the following Prompt the user for the first number (int data type) Read the first number Prompt the user for the second number (int data type) Read the second number Write code to calculate the quotient and remainder when the first number is divided by the second number Make sure to used variables in your output statements. /* OUTPUT Enter the first number: 126 Enter the second number: 31 126...

  • Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user...

    Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user for type of employee (hourly ("h"or "H") or management ("'m" or "M") If the employee is management: . get the annual salary get the pay period (weekly ("w" or "W"), bi-weekly ("b" or "B") or monthly ("m" or e compute the gross salary for the pay period (Divide annual salary by 52 for weekly, 26 for bi-weekly, and 12 for monthly) deduct from gross...

  • Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc....

    Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc. needs a program in which the date and temperature in Celsius degrees of an industry laboratory are recorded and stored in a sequential file. In addition, you can see the recorded data and convert the temperatures in the following units: Fahrenheit, Kelvin and Rankine. In addition, they want to see a linear graph that reflects how the temperature has fluctuated day by day, for...

  • *** C++ *** Create a class called Student that contains a first name ( string) and...

    *** C++ *** Create a class called Student that contains a first name ( string) and an student id number (type long).     1. Include a member function called get_data( ) to get data from the user for insertion into the object,     2. Also include a function called display_data( ) that displays the student data. Then write a complete program that uses the class to do some computation. Your main function, main( ), should create a Dynamic Array of...

  • Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and...

    Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and a driver program called invoiceDriver.cpp. The class Invoice is used in a hardware store to represent an invoice for an item sold at the store. An invoice class should include the following: A part number of type string A part description of type string A quantity of the item being purchased of type int A price per item of type int A class constructor...

  • C++ language I need to update this code with the following: ask the user for how...

    C++ language I need to update this code with the following: ask the user for how many structures they would like. Once you get the number, allocate an array of pointers. Once they have been created, proceed to loop through and get the data as usual, and display it back to the screen. struct record {    int age;    string name; }; int check(record r[], int n, string nm) {    for (int i = 0; i < n;...

  • How would I do this problem? Write a C++ menu driven Payroll program. Must be user...

    How would I do this problem? Write a C++ menu driven Payroll program. Must be user friendly.   Menu 1. Check data file   2. Read Data file 3. Process payroll for one employee 4. Process payroll for all employees 5. Print out to a text or an HTML file 6. Exit You must use the following Payroll classes, structures, pointers, arrays, enum, vector, recursive, advance file I/O, STL, template, iterators and containers. The program to process an input file below to...

  • Please can someone help me with making this program in JAVA implementing classes. Also, include loops...

    Please can someone help me with making this program in JAVA implementing classes. Also, include loops and selection structures. A mobile service provider has three different subscription packages for its customers: Package A: For $50 per month, 5 GB data are provided. Additional data is $15 per GB. Package B: For $65 per month, 10 data are provided. Additional data is $10 per GB. Package C: For $75 per month unlimited data provided. Text messaging and voice services are included...

  • Can I please get help to write a code in C# that allows the user to enter an address and returns this as an output This will need to be a seperate class that is going to pass it to a method contained...

    Can I please get help to write a code in C# that allows the user to enter an address and returns this as an output This will need to be a seperate class that is going to pass it to a method contained in another console application. For example, this method will be called in another console application by: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Address; where Address is the title of the other class...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT