Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Array Bags, String, and StringBuilder a) Write a class called Student that has the following fields: name, id, and gpa. Write a constructor, setters, getters,

image text in transcribed

Array Bags, String, and StringBuilder a) Write a class called Student that has the following fields: name, id, and gpa. Write a constructor, setters, getters, and the toString() method. Then write a BodyBag class that can be used to hold the maxSize number of Students using an array. The BodyBag class should have methods to add, find, remove, and display student objects. The find and remove methods should find and remove by the student id number. Once found or removed, the methods should return the found or removed student object. The display method should display all of the students in the bag. Write a demo class to demonstrate how the Student and BodyBag classes work. b) Write a method called reverse in a class called StringManipulation. The method should reverse any given String. So "TIP" becomes "PIT", and "Hello" becomes "olleH". Write a method called encryptChar in a class called Encryption. The method should shift a given letter by a given n positions in the alphabet and return the shifted character. So if n = 3, 'a, becomes 'd', 'z' becomes 'c', etc c) d) Write a method called encryptString in a class called Encryption2. The method should shift each letter in a given String by a given n positions and then return the shifted String Write a Java Bag class that will hold a collection of numbers of int type. The Bag class should also ) have methods to find the maximum, minimum, and average of the collection, in addition to the usual add, remove, and display methods. Write a Demo program that will add 11 numbers into the bag, then remove one number, and finally display the maximum, minimum, and average of the remaining ten numbers. Write a Student class that has name and gpa fields. Write all the mutator and accessor methods. Finally, write code so this class has a curveGPA(double curveAmount) method that curves a student object's GPA by a given curveAmount. Write a demo program to curve a given student's GPA by 0.2 Create a Book class. It should have the following three instance variables: title, author, and price. Write a Demo class that will ask the user to provide such information about two books using the keyboard. These two book objects will then be created and displayed on the console

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

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions