Write a program to manage dvd rental in a video rental


Part 1

Assignment 3 requires you to write three C±± programs using the inforrnalbon you have studied in Units 8-13,
C++ Programs

Write a program in which you create a mist whose value is determined at runtime by reading i.he time when the program starts (hint: use the ‹ctime> standard header). In a separate function, have the program create two arrays of 10,000 doubles.

Initialize the first array with sequential integral values starting with 100, and In the second array with the same numbers, but in reverse order {i.e., the first array would contain 100, 101, 102... while the  second array contains 1009g, 10,098, 10,097_ ).

Loop through both arrays using a single loop, and multiply the corresponding array elements from each array together and display the result. Rea the time when the program completes the multiplication, and compute and display the elapsed time. Do not use inIfne functions in this program.

Rewrite program 1 using an inline function to perform the calculation. In the test plan for this program {aaLeal results section), compare the lime required by this program to execute against the time required by the first (non-inline) program.

1. Write a program thal creates a class hierarchy for simple geometry. Start with a Point class to hold x and' values of a point. Overload the operator to print point values a n the and - operators to add and subtract point coordinates (hint: keep x and y separate In the calculation).

2. Create a base cIa 9S Shape whicil will form the basis of your shapes. The Shape class will contain functions to calculate area and circumference of the shape, plus provide the coordinates (Points) of a rectangle that encloses the shape (a bounding box). These will be overloaded by the derived classes as necessary. Create a display() function that will display the name of the class plus all stored information about the class {including area, circumference, and bounding box),

3. Bulb the hierarchy by creating the Shape classes C[role, Square, and Triangie. For these derived classes, create default constructors and constructors whose arguments can initialize the shapes appropriately using the correct number of Point objects (i.e., Circle requires a Point center and a radius: Square requires four Point vertices, while Triangle requires three Point vertices),

4. In main(), create one instance each of the following: a Circle with a radius of 23, a Square Noah sides 25, and a Triarigle with sides 10, 20, 30. Define all of them so that the origin (0„0) is somewhere within each object Display the information from each eh act.

Part 2

Assignment 2 requires you to write three C++ Pr°grams using the information you have studied in Units 4-7_
C++ Programs

1. Write a program to manage DVD rental in a video rental store. Create an abstract data type that represents a DVD in this store_ Consider all the data and operations that may be necessary for the DVD type to work well within a rental management system. Include a print° member function that displays all the information about the DVD. Test your data type by creating an array of ten DVD instances and filling them using information read from a test input file that you create_ Display the DVD information.

2. Write a pro-gram in which you create a I-len class. Inside this class_ nest a Nest class. Inside Nest, place an Egg class. Each class should have a display() member funcifion. For each class, create a constructor and a desiructor that prints an appropriate message when it is CZ lied. In main(), create an instance of each class using new and call the display() function for each one. After calling display{). free the storage using delete_

3. Write a program in which you create a Text class that contains a string object to hold the text of a file. Give it two constructors! a default constructor and a constructor that takes a string argument that is the name of the file to open. When the second constructor is used, oper: the file and read the contents of the fle into the string member object. Add a member function contents() to return the string so that you can display it. In maln(). men a tile .sing Text and display the contents.

Part 3

Assignment 1 requires you to write fourC++ programs and one makefile using the information you have studied in Units 1-3.

C++ Programs

1. Write a program that opens a file and counts the whitespace-separated words in that file.

2. Write a program that opens a (text) file, and displays the contents of that file one line at a lime. After a line has been displayed, the program should wait for the user to press the key before displaying the next line in the file.

3. Write a program that uses two nested for loops and the modulus operator (%) to detect and print the prime numbers from 1 to 10,000. (Prime numbers are natural numbers that are not evenly divisible by any other number except for themselves and one). Display all the primes found.

4. Write a program that creates an array of 100 string objects_ Fill the array by having your program open a {text) file and read one line of the fi:e into each string until you have filled the array. Display the array using the format "line ," where # is the actual line number (you can use the array counter for this value) and is the stored string.

5. Create a rnakerile for one of the exercises in this assignment (your choice) that allows the user to type make for a production build of the program and make debug for a build of the program that includes debugging information.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program to manage dvd rental in a video rental
Reference No:- TGS02580276

Expected delivery within 24 Hours