Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
Complete all the following questions correctly as they are linked and connected altogether in Java
1. Create a class named 'Student' with String variable 'name' and integer variable 'roll_no'. Assign the value of roll_no as '2' and that of name as
"John" by creating an object of the class Student.
2. Assign and print the roll number, phone number and address of two students having names "Sam" and "John" respectively by creating two objects
of class 'Student'.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write in Javaarrow_forwardcreate a program for these to questions using javaarrow_forwardWrite a program to illustrate how to use the class studentType. Struct studentType: struct studentType { string firstName; string lastName; char courseGrade; int testScore; int programmingScore; double GPA; }; An example of the program is shown below: Name: Sara Spilner Grade: A Test score: 89 Programming score: 92 GPA: 3.57 *************** C++ code pleasearrow_forward
- Write a program that converts a number entered in Roman numerals to decimal. Your program should consist of a class named Roman, and an object of type Roman should do the following: a) Store the number as a Roman numeral. b) Convert and store the number into decimal. c) Print the number as a Roman numeral or decimal number as requested by the user The decimal values of the Roman numerals are: • M • D 1000 500 100 L 50 10 1 X > -arrow_forward5. CODE IN PYTHON Create a BankAccount class which has an __init__ method which accepts an account name and starting balance to store as instance fields. The class should also have a method to deposit money, a method to withdraw money, and a method called "get_balance" which returns a string of the format "{account_name} has a balance of {balance}" (do not print this out from within the class, just return the string). In the same file, create an instance of the BankAccount class with a hardcoded name and starting balance. Deposit any amount to the account and withdraw any amount from the account (both can be hardcoded) and then print the result of calling the get_balance method on the instance.arrow_forwardJAVA Code Write a complete UML class diagram for the class described below. Use a line of minus signs to separate sections. Don't worry about drawing a box or centering any text. Do include all proper UML notation. Your need to create an instantiable class that represents a asteroid heading towards Earth. This class should be named Asteroid. It will contain three fields: a string named name and a mass and velocity, measured in kg and m/s respectively, each of which can accept numbers with decimal points. An observatory wants to know how much kinetic energy each asteroid will have as it passes or hits the earth. The class needs one constructor that sets the values of all the fields. The class needs the following public methods: Getters and setters for all fields. A method called getKineticEnergy that calculates and returns the kinetic energy of the asteroid. (Kinetic energy is calculated as 0.5 x mass x velocity2.) Standard methods: toString, equals, and hashCode where equals and…arrow_forward
- 1)Create a complete Java class that can be used to create a Computer object as described below:A Computer has a:- Manufacturer- Disk Size- Manufacturing Date- Number of coresa) Add all instance variables (data encapsulation is expected).b) The class must have getters and setters for all instance variables.c) The class must have two constructors: a no-arg constructor and a constructor thatreceives input parameters for each instance variable.d) Implement a toString() method for your class. 2)Write a Java program TestComputer, which creates three Computer objects with the informationbelow:a) - Manufacturer: Dell- Disk Size: 1189160321024 bytes- Manufacturing Date: April 1, 2020- Number of cores: 2b) - Manufacturer: Apple Inc- Disk Size: 269283712040 bytes- Manufacturing Date: March 31, 2020- Number of cores: 4c) Create your own Object. You can mimic your actual personal computer or use a no-argsconstructor.Print the three objects using toString() method to show all data fieldsarrow_forwardJava- Suppose that Vehicle is a class and Car is a new class that extends Vehicle. Write a description of which kind of assignments are permitted between Car and Vehicle variables.arrow_forwardWrite a complete Java class that can be used to create a Fish object as described below: A Fish has-a: - name age - type favorite food a) Add all instance variables b) The class must have getters and setters for all instance variables c) The class must have two constructors: a no-args constructor and a constructor that receives all data fields as parameters d) The class must have a toString() e) Add a main method and create 2 Fishes using each of the constructors you createdarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education