Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92593447

Have any Question?


Related Questions in Programming Language

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As