Tags:
tag this topic
create new tag
view all tags
---++ Ninth Programming Lab, ITSC 121, Spring 2020 ---+++Overview Write the following programs. The first one deals payroll. The second deals with searching ---++++Program 1: Payroll (edited problem 8.4) Suppose the weekly hours for all employees are stored in a 2-dimensional array. Each row records an employee's seven-day hours with seven columns. For example, the following array stores the work hours for eight employees. Write a program that displays employees and their total hours. For extra credit, display the total hours in decreasing order. Use -1 to indicate the end of data. You must use a 2D array to store the data before doing any computations. <pre> Su M T W Tu F Sa Employee 0 2 4 3 4 5 8 8 Employee 1 7 3 4 3 3 4 4 Employee 2 3 3 4 3 3 2 2 Employee 3 9 3 4 7 3 4 1 Employee 4 3 5 4 3 6 3 8 Employee 5 3 4 4 6 3 4 4 Employee 6 3 7 4 8 3 8 4 Employee 7 5 3 5 9 2 7 9 Results: (for extra credit) 7 41 hours 6 37 hours 0 34 hours 4 32 hours 1 28 hours 5 28 hours 3 21 hours 2 20 hours Results for full credit: 34 28 20 21 32 28 37 41 </pre> The input would just be the numbers with a -1 indicating the end of data (a set of 7 -1's would also be okay) ---++++Program 2: Searching (adapted problem 8.13) Write the following method that returns the location of the largest element in a 2-dimensional array:<br> <b>public static int[] locateLargest(double[][] a)</b><br> The return value is a one dimensional array that contains two elements. These two elements indicate the row and column indices of the largest element in the two-dimensional array. Write a test program that prompts the user to enter a two-dimensional array and displays the location of the largest element in the array. Here is a sample run: <pre> Enter the number of rows and columns of the array: 3 4 Enter the array: 23.5 35.2 2 10 4.5 3 45 3.5 35 44 5.5 9.6 The location of the largest element is at (1,2) </pre> ---+++Reminders 1. Include proper comments for all 1. Use proper formatting, etc. 1. Test with more than one set of data where it is appropriate 1. Get the correct data outputted on the program before worrying about formatting ---+++Submissions 1. Create a software development report that includes the following for the program: * A problem summary (the big picture) for each program * A list of requirements for each program. (Things that this particular implementation of a solution must do) * A list of steps each of your programs do * A testing report for each program: What exact input you used and what output you got. * How long it took to write it, and how much time was on it each day! * Who you got help from (if you got help) * Changes (if any) you would make if you had more time and/or skill * At least two things you learned while writing the program(s) 1. Create a <b>zip</b> folder with your software development report(s) and your java file(s) and submit that to canvas. 1. Due date can be found on canvas
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2021-10-19
-
cathybareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback