Question
A Java program to create objects and printout attribute values. Modify the program below using InteliJ or Netbeans Java, and submit the new copy on
A Java program to create objects and printout attribute values. Modify the program below using InteliJ or Netbeans Java, and submit the new copy on VPL for automatic grading.
Package student;
class student {
//ATTRIBUTE/PROPERTY SECTION
String studName, studDept;
int test1, test2, assign1, studNumber, totalMark;
}
public class student1 {
public static void main(String[] args) {
//CREATION OF OBJECT
student obj = new student();
stud.studName = "Teresia Aka";
//PRINTING SECTION-METHOD
System.out.println("Student Name: "+stud.studName);
}
}
Lab work:
(a) change the object name to stud
(b) create the following objects and assign these values to them:
studNumber 93100191
studDept Computer Science
test1 23
test2 18
assign1 20
(c) Only the attribute value for studName is currently printed, print out all the other attribute values
(d) The formula to calculate Total Mark is: totalMark = test1 + test2 + assign1
(e) Submit the modified program on VPL for automatic grading.
Sample run:
Student Name: Teresia Aka
Student Number: 93100191
Student Department: Computer Science
Test1: 23
Test2: 18
Assignment: 20
Total Mark: 61
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started