Read Chapter 8
Write programs to solve following two tasks:
Task#1
Write a method smallestIndex, that takes an integer array as its parameters and returns the index of the (last occurrence of the) smallest element in the array. Also, call the method smallestIndex to test the method.
Task#2
Three employees in a company are up for a special pay increase. You are given a file, say InputData.txt, with the following data:
Miller Andrew
65789.87
5
Green Sheila
75892.56
6
Sethi Amit
74900.50
6.1
First line contains an employee’s name, next line his current salary, and the next line is percent pay increase. For example, in the first input line, the name of the employee is Miller Andrew, the next line contains his current salary is 65789.87, and the line after contains his pay increase is 5%. The same pattern repeats 3 times.
Write a method ReadingWriting which accepts a file of the following format as input. The method ReadingWriting does the following:
reads data from the InputData.txt file
Write output in the output file out.txt.
For each employee, the data must be outputted in the following way:
name, updatedSalary.
Calculate updatedSalary using the formula:
updatedSalary = current salary + (current salary * pay increase)
Format the updatedSalary of decimal numbers to two decimal places.
Note
Last Completed Projects
| topic title | academic level | Writer | delivered |
|---|
Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]