Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 3 Directions 1 . Create an algorithm to calculate a paycheck. The inputs will be a number of hours worked, a pay rate per

Assignment 3 Directions 1. Create an algorithm to calculate a paycheck. The inputs will be a number of hours worked, a pay rate per hour, and a bonus. 2. The program will read in two or three integers, the first will be the number of hours worked, the second will be the pay rate. If there is a third number it will be a bonus added onto the pay after the multiplication. 3. Implement the program in a high level language like C, C++, or Java.4. Implement the program in MIPSzy Assembly language. Use the high level code as comments to the right of the Assembly code as the textbook does. 5. If you write that MIPSzy program in a text editor, you can then paste it into the simulator box in 11.1.2 of Chapter 11 in the ZYBook. You can run the simulation there to test the code. 6. The input values should be entered in the input box before hitting run. Do not worry if the line wraps to the next line. 7. Input works by placing the value to be read in from the input box in memory location 8196 and a 1 in memory location 8192. If there is no more input a 0 will be placed in memory location 8192. as a space delimited list. See the sample below. 8. Results should be written to memory location 8200 which will cause them to be written to the output window. 9. Include a comment at the top of the program with your name and Panther id.10. Export the file by clicking the More Options button and then Export on the right side. That will paste your program into a small box on the right. Copy and paste that into a text document. Call that document FirstnameLastnameA3.txt.11. Submit FirstnameLastnameA3.txt.1. Create an algorithm to calculate a paycheck. The inputs will be a number of hours worked, a pay rate per hour, and a bonus. 2. The program will read in two or three integers, the first will be the number of hours worked, the second will be the pay rate. If there is a third number it will be a bonus added onto the pay after the multiplication. 3. Implement the program in a high level language Java.4. Implement the program in MIPSzy Assembly language. Use the high level code as comments to the right of the Assembly code as the textbook does. 5. If you write that MIPSzy program in a text editor, you can then paste it into the simulator box in 11.1.2 of Chapter 11 in the ZYBook. You can run the simulation there to test the code. 6. The input values should be entered in the input box before hitting run. Do not worry if the line wraps to the next line. 7. Input works by placing the value to be read in from the input box in memory location 8196 and a 1 in memory location 8192. If there is no more input a 0 will be placed in memory location 8192. as a space delimited list. See the sample below. 8. Results should be written to memory location 8200 which will cause them to be written to the output window. 9. Include a comment at the top of the program with your name and Panther id.10. Export the file by clicking the More Options button and then Export on the right side. That will paste your program into a small box on the right. Copy and paste that into a text document. Call that document FirstnameLastnameA3.txt.11. Submit FirstnameLastnameA3.txt.Here is a sample of the input and output:Input: 3218100Output: 676A sample program to show how to manage input and output is as follows. Type a single digit integer number in the Input box and run the program.addi $t0, $zero, 8200 # Output locBegLoop: addi $t6, $zero, 8192 # Input ready? lw $t5,0($t6) beq $t5, $zero, NoInput addi $t6, $zero, 8196 # Input loc lw $t1,0($t6) addi $t2, $zero, 1 sw $t2,0($t0) # Output to screen mul $t2, $t2, $t1 # Times Input sw $t2,0($t0) # Output to screen mul $t2, $t2, $t1 # Times Input sw $t2,0($t0) # Output to screen mul $t2, $t2, $t1 # Times Input sw $t2,0($t0) # Output to screen j BegLoopNoInput:
Instructions:
Submit the java project folder as a .zip file.
Write a java program to implement the following algorithms for Open Addressing techniques for Hash Table data structure. (Use a simple array of integers to store integer key values only).For both algorithms, to compute the index j, write the following methods:
getLinearProbIndex (key, i)
getQuadraticProbIndex (key, i)
getDoubleHash (key, i)
Linear Probing index is computed using following hash function:
h(k,i)=(h1(k)+i)modm
h1(k)=kmodm
Quadratic probing index is computed using following hash function:
COP3530- Assignment 5
Page 1 of 2
h(k,i)=(h1(k)+i2)modm
h1(k)=kmodm
Double hashing index is computed using following hash function:
h(k,i)=(h1(k)+ih2(k))modm
h1(k)=kmodm
h2(k)=1+(kmodm-1)
Instructions:
Submit the java project folder as a .zip file.
Write a java program to implement the following algorithms for Open Addressing techniques for Hash Table d
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions