Question

Option Explicit On Option Strict On Module PayrollReport Sub Main() Dim Name As String Dim GrossString...

Option Explicit On
Option Strict On
Module PayrollReport
Sub Main()
Dim Name As String
Dim GrossString As String
Dim Gross, Deduct, Net As Double
Const RATE As Double = 0.25
Const QUIT As String = “XXX”
Const REPORT_HEADING As String = “Payroll Report”
Const END_LINE As String = “**End of report”

‘ Work done in the housekeeping() procedure
System.Console.WriteLine(REPORT_HEADING)
Name = InputBox$(“Enter employee’s name: “)
While(Name <> QUIT)
‘ Work done in the detailLoop() procedure
GrossString = InputBox$( _
“Enter employee’s gross pay: “)
Gross = Convert.ToDouble(GrossString)
Deduct = Gross * RATE
Net = Gross - Deduct
System.Console.WriteLine(“Name: “ & Name)
System.Console.WriteLine (“Gross Pay: " & Gross)
System.Console.WriteLine (“Deductions: “ & Deduct)
System.Console.WriteLine (“Net Pay: “ & Net)
Name = InputBox$(“Enter employee’s name: “)
End While
‘ Work done in the endOfJob() procedure
System.Console.WriteLine(END_LINE)
End Sub
End Module

modify the program to additionally ask the user for an employee number which will be a numeric value such as 3234 with no decimals. Also prompt the user to enter in bonus pay. Since this is a monetary amount, make sure the user can enter values with a decimal point such as 30.45. Currently the Net is set to be equal to the Gross minus the Deduct. Modify this so that the Net is set equal to the Gross minus Deduct plus the Bonus amount. Also change the program to display the employee number as well as the bonus amount for the user along with the other report data. Finally, examine the program in regard to which of the 3 basic structures are included in the solution. ------- The three basic structures—sequence, selection, and loop

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

Module Module1
Sub Main()
Dim Name As String
Dim GrossString As String
Dim empnumber As Integer
Dim empnumber1 As String
Dim Bonuspay1 As String
Dim bonuspay As Double
Dim Gross, Deduct, Net As Double
Const RATE As Double = 0.25
Const QUIT As String = "XXX"
Const REPORT_HEADING As String = "Payroll Report"
Const END_LINE As String = "**End of report"
' Work done in the housekeeping() procedure
System.Console.WriteLine(REPORT_HEADING)
Name = InputBox$("Enter employee’s name: ")
While (Name <> QUIT)
empnumber1 = InputBox$( _
"Enter employee's Number: ")
' Work done in the detailLoop() procedure
GrossString = InputBox$( _
"Enter employee’s gross pay: ")
Bonuspay1 = InputBox$( _
"Enter employee’s bonus pay: ")
empnumber = Convert.ToInt16(empnumber1.ToString())
bonuspay = Convert.ToDouble(Bonuspay1.ToString())
Gross = Convert.ToDouble(GrossString)
Deduct = Gross * RATE
Net = Gross - Deduct + bonuspay
System.Console.WriteLine("Name: " & Name)
System.Console.WriteLine("Employee Number: " & empnumber1)
System.Console.WriteLine("Gross Pay: " & Gross)
System.Console.WriteLine("Deductions: " & Deduct)
System.Console.WriteLine("Bonus Pay: " & bonuspay)
System.Console.WriteLine("Net Pay: " & Net)
Name = InputBox$("Enter employee’s name: ")
End While
' Work done in the endOfJob() procedure
System.Console.WriteLine(END_LINE)
End Sub
End Module
ConsoleApplication 14 (Running) - Microsoft Visual Studio Ffile:///C:/Users/dell/Documents/Visual Studio 2008/Projects/Consol

ConsoleApplication14- Microsoft Visual Studio Window Help File Edit View Project Build Debug Data Tools Test 2 Debug Any CPUConsoleApplication14- Microsoft Visual Studio Window Help File Edit View Project Build Debug Data Tools Test - Debug Any CPU

Add a comment
Know the answer?
Add Answer to:
Option Explicit On Option Strict On Module PayrollReport Sub Main() Dim Name As String Dim GrossString...
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 need to write a loop that examines the names of the cities stored in the...

    I need to write a loop that examines the names of the cities stored in the array. Write code that tests for a match Write code that, when appropriate, prints the message: Not a city in Illinois _______________________________________________________________ ' IllinoisCities.vb - This program prints a message for invalid cities in Illinois. ' Input: Interactive ' Output: Error message or nothing Option Explicit On Option Strict On Module IllinoisCities    Sub Main()       ' Declare variables.         Dim city As String                 ...

  • Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate...

    Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate the weekly paycheck for both Salaried and Hourly employees. Salaried employees will be paid 1/52 of their annual pay minus 18% withheld for federal and state taxes, as well as 4% for retirement pension. Salaried employees do not collect overtime pay. There are two types of Hourly employees; permanent employees and temporary weekly employees. •Permanent weekly employees will be paid their hourly rate minus...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • in java PART ONE ================================================== Write a program that will read employee earnings data from an...

    in java PART ONE ================================================== Write a program that will read employee earnings data from an external file and then sort and display that data. Copy and paste the input file data below into an external file, which your program will then read. You will want to use parallel arrays for this program. Modify the select sort algorithm to receive both arrays as parameters as well as the size of the arrays. Use the algorithm to sort your earnings array....

  • 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...

  • employee.h ---------- #include <stdio.h> #include <iostream> #include <fstream> class Employee { private: int employeeNum; std::string name;...

    employee.h ---------- #include <stdio.h> #include <iostream> #include <fstream> class Employee { private: int employeeNum; std::string name; std::string address; std::string phoneNum; double hrWage, hrWorked; public: Employee(int en, std::string n, std::string a, std::string pn, double hw, double hwo); std::string getName(); void setName(std::string n); int getENum(); std::string getAdd(); void setAdd(std::string a); std::string getPhone(); void setPhone(std::string p); double getWage(); void setWage(double w); double getHours(); void setHours(double h); double calcPay(double a, double b); static Employee read(std::ifstream& in); void write(std::ofstream& out); }; employee.cpp ---------- //employee.cpp #include...

  • This program will store a roster of most popular videos with kittens. The roster can include...

    This program will store a roster of most popular videos with kittens. The roster can include at most 10 kittens.You will implement structures to handle kitten information. You will also use functions to manipulate the structure. (1) Create a structure kitten. The structure should contain the following attributes: name; string color; string score; integer Important! The name of the structure and each of its field must match exactly for the program to work and be graded correctly. (2) Create a...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • Hello, I have some errors in my C++ code when I try to debug it. I...

    Hello, I have some errors in my C++ code when I try to debug it. I tried to follow the requirements stated below: Code: // Linked.h #ifndef INTLINKEDQUEUE #define INTLINKEDQUEUE #include <iostream> usingnamespace std; class IntLinkedQueue { private: struct Node { int data; Node *next; }; Node *front; // -> first item Node *rear; // -> last item Node *p; // traversal position Node *pp ; // previous position int size; // number of elements in the queue public: IntLinkedQueue();...

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