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

An experienced developer tries to compile the code below. It seems like it shoul

ID: 3837993 • Letter: A

Question

An experienced developer tries to compile the code below. It seems like it should work but it won't even compile - see error in bold below. What did the developer overtook? What's the problem here, and what is the simple fix? Student student = Student ();//create An Instance//set some properties ... student. setFirstName("Joe");//updating method call student. setLastName ("Peterson");//updating method call System, out .println (student);//Display student "state" The method Student () is undefined for the type Student Student.java/CSC330/src/edu/cuny/csi/csc330/examples line 1 Decipher "the code" snippet lines... As done in class, review the code below, and based on what we've learned about Java: standard naming conventions statement "types" syntax ...describe what each line of code is doing - in plain English, but use the appropriate terms For example: "an instance of SomeClass is being created (or instantiated)", would be an accurate description of this one line of code: SomeClass theObject = new SomeClass ();

Explanation / Answer

1)

At the very first line the instance of the class Student is created wrong.

instead of Student student= Student(); , Student student= new Student(); should be there.

2)

Standard naming convention:

Standard naming convention is set of certain rules which are define for the programming community in order to make better understanding of source code of one another, like the style of declaring a variable the name of the variable must be logical, suppose you are creating a class named car and it's property is maxSpeed, for maximum speed it can reach but if you take the name minSpeed for the max speed there will be lot of confusion for the person other than you to read and understand the code,

Statement "types":

Statement are the one who controls the control flow of the program.


Syntax:

Syntax is also set of rules which are defined for a particular language in order to make it understandable by the compiler.

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