Question

C# please...

Design a program that uses the following parallel arrays:

empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following

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

Please check below Code to calculate Employee Wages in C# by storing data in Arrays

using System;   
public class Employee
{
   public static void Main()
   {
       Console.WriteLine("Employee Wages Calculator:");
       int [] empId = new int[7] { 56588, 45201, 78951, 87775, 84512, 13028, 75804};
       int [] hours = new int[7];
       double[] payRate = new double[7];
       double[] wages = new double[7];
       for (int i = 0; i < empId.Length; i++)
       {
           Console.WriteLine("Enter Number of Housrs and Pay Rate for Employee Id:{0}", empId[i]);

           /* Reads Hours and converts to integer */
           Console.Write("Hours:");
           hours[i] = Convert.ToInt32(Console.ReadLine());
          
           /* Reads Pay Rate and converts to Real */
           Console.Write("Pay Rate:");
           payRate[i] = Convert.ToDouble(Console.ReadLine());
          
           /* Calculate Gross Wages */
           wages[i] = hours[i]*payRate[i];

       }
      
       for (int j = 0; j < empId.Length; j++)
       {
           /* Prints all Employee Identification number and Gross Wages */
           Console.WriteLine("Employee Identification Number: {0}, Gross Wage: {1}", empId[j], wages[j]);
       }
      
   }
}

Add a comment
Know the answer?
Add Answer to:
EmpId: An array of seven Integers to hold employee identification numbers. The array should be in...
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
  • I hope some one can help me with the Python excercise (coding) Design a program that...

    I hope some one can help me with the Python excercise (coding) Design a program that uses the following parallel arrays: ● empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers: 56588 45201 78951 87775 84512 13028 75804 ● hours: An array of seven Integers to hold the number of hours worked by each employee. ● payRate: An array of seven Reals to hold each employee’s hourly pay rate....

  • in C++ Write a program which uses the following arrays: empID: An array of 7 integers...

    in C++ Write a program which uses the following arrays: empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7. Hours: an array of seven integers to hold the number of hours worked by each employee. payRate: an array of seven doubles to hold each employee’s hourly pay rate. Wages: an array of seven doubles to hold each employee’s gross salary. The program...

  • C++ Linked Lists You have been hired by Employees. Inc to write an employee management system....

    C++ Linked Lists You have been hired by Employees. Inc to write an employee management system. The following are your specifications: Write a program that uses the following linked lists: bullet empId: a linked list of seven long integers to hold employee identification numbers. The array should be initialized with the following numbers: 5658845 4520125 7895122 8777541 8451277 1302850 7580489 bullet hours: a linked list of seven integers to hold the number of hours worked by each employee bullet payRate:...

  • Program is to be written In C++, The output should look like the screen shot. It...

    Program is to be written In C++, The output should look like the screen shot. It should allow the user to continue to ask the user to enter all employee ID's until done and then prompt the user to enter the hours and pay rate for each employee ID. Please help:( Can you please run the program to make sure the output is just like the screenshot please? It needs to have the output that is in the screenshot provided,...

  • In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an...

    In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an array of structs to hold the employee information for all employees. If you choose to declare a separate struct for each employee, I will not deduct any points. However, I strongly recommend that you use an array of structs. Be sure to read through Chapter...

  • Given attached you will find a file from Programming Challenge 5 of chapter 6 with required...

    Given attached you will find a file from Programming Challenge 5 of chapter 6 with required you to write a Payroll class that calculates an employee’s payroll. Write exception classes for the following error conditions: An empty string is given for the employee’s name. An invalid value is given to the employee’s ID number. If you implemented this field as a string, then an empty string could be invalid. If you implemented this field as a numeric variable, then a...

  • using c++ output format should look this but use employee id,hours worked and pay rate and...

    using c++ output format should look this but use employee id,hours worked and pay rate and the total should be calculated. for example employee id:1234 hours work:29.3 pay rate:16.25 administrative, office and field should be outputted as well too. Using a structure, and creating three structure variables, write a program that will calculate the total pay for thirty (30) employees. (Ten for each structured variable.) Sort the list of employees by the employee ID in ascending order and display their...

  • You are to write a program that will process employees and their pay. For each employee...

    You are to write a program that will process employees and their pay. For each employee the program will read in an employee’s name and hourly pay rate. It should also read in the number of hours worked each day for 5 days and calculate his or her total number of hours worked. You must read the hours using a loop. The program should output the employee’s name, gross pay, total withholding amount and net pay. Withholding is made up...

  • Design a Payroll class with the following fields:

    IN JAVADesign a Payroll class with the following fields:• name: a String containing the employee's name• idNumber: an int representing the employee's ID number• rate: a double containing the employee's hourly pay rate• hours: an int representing the number of hours this employee has workedThe class should also have the following methods:• Constructor: takes the employee's name and ID number as arguments• Accessors: allow access to all of the fields of the Payroll class• Mutators: let the user assign values...

  • Write a C++ program that simulates a lottery game. Your program should use functions and arrays....

    Write a C++ program that simulates a lottery game. Your program should use functions and arrays. Define two global constants: - ARRAY_SIZE that stores the number of drawn numbers (for example 5) -MAX_RANGE that stores the highest value of the numbers ( for example 9 ) The program will use an array of five integers named lottery, and should generate a random number in the range of 0 through 9 for each element of the array. The user should enter...

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