Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Student: Michael Reyes
2. Write a Java program that would resemble a payroll system. An input window that will accept the employee number and the number of days of rendered work. A 2d-ArrayList that contains the employee number and the rate per day is to be searched and used to compute the gross salary. Gross salary is computed by multiplying the number of days of rendered work by the rate per day of the particular employee. If the gross salary computed is greater than 100,000 the tax is 20% of the gross salary, otherwise, the tax is 10%. Deduct the tax from the gross salary to get the net pay. Display the employee number, gross salary, tax deduction, and net pay in an output window. Design your own input/output windows. (USE OOP CONCEPT JFRAME)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- C++arrow_forwardJAVA you guys returned the question and said that it is a writing assignment but it is not. It is a java question, multiple-choice no coding. Please help me with this.arrow_forward1. Array splitting in Java Create an integer array with 10 integer numbers, initialize the array arbitrarily but make sure there are both positive and negative integers. Then generate two arrays out of the original array, one array with all natural numbers (positive numbers or zeros) and another one with all negative numbers. Print out the number of elements and the detailed elements in each array.arrow_forward
- Java code 8. Given an existing ArrayList named friendList, find the first index of a friend named Sasha and store it in a new variable named index. 9. Given that an ArrayList of Integers named numberList has already been created and several values have already been inserted, write the statement necessary to insert the value 25 at the end of the list. 10. Declare an integer array named evens and fill it with even numbers from 2 through 10 in one statement. 11. Given an existing array named pets, find the size of the array and store it in a new variable named numPets. 12. Given an existing ArrayList named contactList, find the number of contacts in the ArrayList and store it in the existing variable named numContacts.arrow_forwardIN JAVA Given an array, write a program to print the array elements one by one in a new line. If the array element is divisible by 4, print Four. If it is divisible by 6, print Six. If it is divisible by both 4 and 6, print Four Six. Use the following input array Int[] input_array = {2, 5, 10, 8, 18, 24, 3, 48, 30, 9, 12} Output should be 2 5 10 Four Six Four Six 3 Four Six Six 9 Four Sixarrow_forwardCreate the following program to demonstrate working with arrays in java. Your company pays its sales staff on a commission basis. Each employee receives $500 per week plus 6.5% of their sales. For example, a salesperson who sells $10,000 worth of products will get a salary of 500 + (10000 * .065) or $1150 for that week. You are given the task of creating a program to allow a manager to enter in the sales for 10 employees. (Store them in an array of course.) Then it should display the 10 sales amounts, the 10 salaries for this pay period, and the average salary. (Hint: There are a couple ways to approach this one, here are two ideas: (1) You could create a second array for the salaries and load it at the same time as you gather and store the sales, then loop through the salaries one to find the average, and then you have all the pieces to print. (2) Another solution would be to take in the sales, and then calculate the salaries on the print (which means you don't have to store them in a…arrow_forward
- in java Integer numVals is read from input and integer array userCounts is declared with size numVals. Then, numVals integers are read from input and stored into userCounts. If the first element is less than the last element, then assign Boolean firstSmaller with true. Otherwise, assign firstSmaller with false. Ex: If the input is: 5 40 22 41 84 77 then the output is: First element is less than last element 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class UserTracker { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumVals; int[] userCounts; inti; booleanfirstSmaller; numVals=scnr.nextInt(); userCounts=newint[numVals]; for (i=0; i<userCounts.length; ++i) { userCounts[i] =scnr.nextInt(); } /* Your code goes here */ if (firstSmaller) { System.out.println("First element is less than last element"); } else { System.out.println("First element is not less…arrow_forwardCreate a Java program that will perform the following statements.Perform the following items in a continuous manner. The code solution for the next item will be basedon the code performed on the previous item.1. Create an ArrayList named “apostles” and add the following names to it: Juan, Pedro, Lucas,Judas, Mateo, Marcos and Simon.2. Print the size of the ArrayList to the standard output before and after adding the names.3. Use two methods to print the names in standard output.a. Using For loopb. Using Iterator4. Add the name “Philip” at the end, and add the name “Thomas” between the two names “Juan”and “Pedro”.5. Remove the name “Judas” using its index position.6. Search the names “Marcos”, “James” and “Judas” in the ArrayList “apostles”This part will display the following:Does “apostles” contains Marcos? _______ (it will return a Boolean result)Does “apostles” contains James? _______Does “apostles” contains Judas? _______7. Sort the names of the ArrayList in alphabetical order.8.…arrow_forwardJava program to check whether there is zero (0) value or -1 , if its there then display true otherwise false. Consider the output as follow:arrow_forward
- IN JAVA Write a program to input an integer x and print all the elements which are multiple of x in the array given below. {123, 78, 12, 65, -14, 93, 7, 13, 60, 89}arrow_forwardIn java Define and create an array of 10 integers. The array elements should be initialized to zero.arrow_forwardJAVA PROGRAM Write a program that asks the user to input two integers a and b. Then create an array that has all integer from a to b. Print out the array. (Don’t forget to consider the situation of a=b, a<b, and a>b.) Example 1: Input two numbers: 6 2 Array is [6, 5, 4, 3, 2] Example 2: Input two numbers: 4 8 Array is [4, 5, 6, 7, 8] Pass the above array as a parameter to a method called average and return the average and print it out in the main method. (Do not use Math library to get the average.)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY