Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language is java . Open up a new Java project on Eclipse named Review and create a new class called Review.java. Note that you may

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

language is java

. Open up a new Java project on Eclipse named Review and create a new class called Review.java. Note that you may need to install Eclipse on your home computer first. See the tutorial under the Orientation Module o If you cannot get Eclipse installed, please let me know. This activity should be complete individually. o If you get stuck writing the code, refer to the lesson video (I go step-by-step over how to complete this activity) and the review notes below covering methods, File I/O and arrays Copy and paste the below starter code into your file: * /** @author FILL IN YOUR NAME HERE * CIS 36B, Activity 1.3 */ //write your two import statements here public class Review { public static void main(String[] args) { //don't forget IOException File infile = new File("scores.txt"); //declare scores array //Use a for or while loop to read in data from scores.txt to the array // call method //Use a for loop to write data from array into extraCredit.txt /** * Write complete Javadoc comment here //write your addExtraCredit method here } Next, create a new text file named scores.txt Rick-click the project. Go to New->File. . Name your file scores.txt Make sure the text file gets saved inside the overall project folder (Review), not in the src folder Now, copy and paste the following data (exam scores) into your scores.txt file: 90 95 86 41 79 56 90 83 74 98 56 81 64 99 12 Your program must declare an array of integers, and populate the array with the contents of the file. o You may assume that the length of the array is known to be 15 elements. Next, write a method called addExtraCredit: o The addExtraCredit method takes in one parameter - an array of integers o It adds 2 to each element in the array (hint: think for loop) o It returns nothing Inside of main, call the addExtraCredit method, passing it the array of exam scores. Next, write the contents of the array to a file named extraCredit.txt. o Use PrintWriter to write out to the file (see lesson notes above). When you are finished, extraCredit.txt should contain the following: . Don't forget the title! Scores with Extra Credit: 92 97 88 43 81 58 92 85 76 100 58 83 66 101 14 Hint: Your program should include either 3 for loops or 2 for loops and a while loop. When extraCredit.txt contains the above data, submit Review.java to Canvas

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

1. Explain how business strategy affects HR strategy.

Answered: 1 week ago

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago

Question

What qualities do you see as necessary for your line of work?

Answered: 1 week ago