Questions: 1 835

Answers by our Experts: 1 539

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a class RandomNumber, with three static methods: - GetFloat will return a number between 0 and 1 using the following algorithm:

seed = ( seed * a + c ) % m result = abs ( seed / m )

- GetInt(max) will return a number from 0 to max, using: result = round(max * GetFloat) - GetInt(min, max) will return a number from min to max (you must create this one totally on your own). The starting values must be: m = 233280; a = 9301; c = 49297; seed = 1;


Create a class "House", with an attribute "area", a constructor that sets its value and a method "ShowData" to display "I am a house, my area is 200 m2" (instead of 200, it will show the real surface). Include getters an setters for the area, too. The "House" will contain a door. Each door will have an attribute "color" (a string), and a method "ShowData" wich will display "I am a door, my color is brown" (or whatever

color it really is). Include a getter and a setter. Also, create a "GetDoor" in the house. A "SmallApartment" is a subclass of House, with a preset area of 50 m2.

Also create a class Person, with a name (string). Each person will have a house. The method "ShowData" for a person will display his/her name, show the data of his/her house and the data of the door of that house. Write a Main to create a SmallApartment, a person to live in it, and to show the data of the person.


Complete the project named "Shapes", adding a class named "Square" to it. For each square, we will store its starting X and Y coordinates (the upper left corner, already stored as a "Location") and the length of its side.

You will have to create:

- A suitable constructor, to assign starting values to X, Y and the side. (2 points)

- A Move method, to change X and Y coordinates. (1 point)

- A Scale method, to change its side (for example, a scale factor of 2 would turn a side of 3 into 6). (1 point)

- A method ToString, to return a string with its data (for example: "Corner (10,5), side 7". (1 point)

- Redefine "GetPerimeter" and "GetArea", so that they return the correct values (2 points).

- Another point corresponds to the attributes and the overall structure.

- The remaining 2 points correspond to the test from "Main"


Complete the project named "Shapes", adding a class named "Square" to it. For each square, we will store its starting X and Y coordinates (the upper left corner, already stored as a "Location") and the length of its side.

You will have to create:

- A suitable constructor, to assign starting values to X, Y and the side. (2 points)

- A Move method, to change X and Y coordinates. (1 point)

- A Scale method, to change its side (for example, a scale factor of 2 would turn a side of 3 into 6). (1 point)

- A method ToString, to return a string with its data (for example: "Corner (10,5), side 7". (1 point)

- Redefine "GetPerimeter" and "GetArea", so that they return the correct values (2 points).

- Another point corresponds to the attributes and the overall structure.

- The remaining 2 points correspond to the test from "Main"


Create a class "PhotoAlbum" with a private attribute "numberOfPages."It should also have a public method "GetNumberOfPages", which will return the number of pages.The default constructor will create an album with 16 pages. There will be an additional constructor, with which we can specify the number of pages we want in the lbum. Create a class "BigPhotoAlbum" whose constructor will create an album with 64 pages. Create a test class "AlbumTest" to create an album with its default constructor, one with 24 pages, a "BigPhotoAlbum" and show the number of pages that the three albums have.


Create a new project, and include in it the class Person that you just created. Create a class "Student" and another class "Teacher", both descendants of "Person". The class "Student" will have a public method "GoToClasses", which will write on screen "I’m going to class."The class "Teacher" will have a public method "Explain", which will show on screen "Explanation begins". Also, it will have a private attribute "subject", a string.The class Person must have a method "SetAge (int n)" which will indicate the value of their age (eg, 20 years old). The student will have a public method "ShowAge" which will write on the screen "My age is: 20 years old" (or the corresponding number). You must create another test class called "StudentAndTeacherTest" that will contain "Main" and:

• Create a Person and make it say hello

• Create a student, set his age to 21, tell him to Greet and display his age

• Create a teacher, 30 years old, ask him to say hello and then explain.


Create a class named "Table". It must have a constructor, indicating the width and height of the board. It will have a method "ShowData" which will write on the screen the width and that height of the table. Create an array containing 10 tables, with random sizes between 50 and 200 cm, and display all the data.


Create a Reservation Form for Mumbai-to-Pune Journey containing 3 text fields to enter names, 3 text fields to enter age, & a text field to show Final Bill. It should also contain a radio button showing the type of journey (A.C./Non A.C.). Charges of A.C./Non A.C. modes of journey are fixed but only for child with age < 5 & senior citizen with age > 60 the rates are half. 4% service charges are applied on Final Amount. As per the passenger enter the Final Bill.


Define an abstract class Shape with abstract method CalculateSurface () and fields width and height. Define two additional classes for a triangle and a rectangle, which implement CalculateSurface (). This method has to return the areas of the rectangle (height*width) and the triangle (height*width/2). Define a class for a circle with an appropriate constructor, which initializes the two fields (height and width) with the same value (the radius) and implement the abstract method for calculating the area. Create an array of different shapes and calculate the area of each shape in another array


Write a function that takes a string and split it by words to array of strings.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS