Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Will someone please helpme out with this? i just started in java i tried to writ

ID: 3613637 • Letter: W

Question

Will someone please helpme out with this? i just started in java i tried to write thisprogram but now im more confused than ever.
Can someone please show me how this should look?

scores=(90,80,40,75,90,100) and i have to Write aprogram
that reads the scores from the file and calculates their total andaverage.
Then, create a file called 'output.txt,
and write the total and average to that file.use Scanner andPrintWriter to do this.


: Implement a Triangle class that extends the GeometricObject class(which is at the bottom)


Triangle contains:
- Three double data fields names side1, side2, side3 withdefault values 1.0
- A no-arg constructor that creates a default triangle
- A constructor that creates a rectangle with the specified side1,side2, and side3
- Accessor methods for all three data fields
- A method named getArea() that returns the area of thistriangle
- A method named getPerimeter() that returns the perimeter of thistriangle
- A method named toString() that returns a string description ofthe triangle. This should return "Triangle: side1 = " + side1 + "side2 = " + side2 + " side3 = " + side3;

implement the class,and write a test program that creates a Triangle with sides 1, 1.5,1,
sets color yellow and filled true, then displays the area,perimeter, color,
and whether filled or not.


public class GeometricObject {
private String color = "white";
private boolean filled;
private java.util.Date dateCreated;

/** Construct adefault geometric object */
public GeometricObject() {
    dateCreated = new java.util.Date();
}

/** Return color*/
public String getColor() {
    return color;
}

/** Set a new color*/
public void setColor(String color) {
    this.color = color;
}

/** Return filled.Since filled is boolean,
     so, the get method name is isFilled */
public boolean isFilled() {
    return filled;
}

/** Set a newfilled */
public void setFilled(boolean filled) {
    this.filled = filled;
}

/** Get dateCreated*/
public java.util.Date getDateCreated() {
    return dateCreated;
}

/** Return a stringrepresentation of this object */
public String toString() {
    return "created on " + dateCreated + " color: "+ color +
      " and filled: " + filled;
}
}

Explanation / Answer

Cramster regulations: 1 question per post. ________________________ importjava.io.*; public class InputTest { publicstatic void main(String[]args) throws IOException { //input Scanner input =new Scanner(newFile("input.txt")); int total = 0; int num = 0; while(input.hasNextInt()) { total +=input.nextInt(); num++; } in.close(); //calculations int average =total/num; //output PrintWriter fileout =new PrintWriter(newFile("output.txt")); fileout.println("Total: "+total); fileout.println("Average:"+average); fileout.close(); } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote