Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

fix the code import java.io.*; import java.util.Scanner; class Student{ private String name; private int id; public double q1; public double q2; public double q3; public

fix the code
import java.io.*;
import java.util.Scanner;
class Student{
private String name;
private int id;
public double q1;
public double q2;
public double q3;
public void setName(String name){
this.name=name;
}
public void setld(int id){
this.id=id;
}
public String toString(){
return"Student[name="+name+",id="+id+",q1="+q1+",q2="+q2+",q3="+q3+"]";
}
}
class Main{
public static void main(String[] args) {
Student student1=new Student();
Studentone.setName("jeje");
Studentone.setId(123);
Studentone.q1=80.5;
Student1.q2=90.0;
Student1.q3=70.0;
System.out.println( Student1.toString());
}
}

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

=+b. What is the sunk cost in this situation? 464 Chapter 12

Answered: 1 week ago

Question

3. Keep families informed before problems develop.

Answered: 1 week ago