Question 1
Explain at least not less than five differences between data-oriented programming and
object-oriented programming. In your explanations, include concepts of data-oriented
design, object-oriented design, and use at least five examples which should include
source codes to support your arguments.
Program
Create a program that asks for the student's score and the number of items in a laboratory exercise. It will then compute for the grade using the formula. I recommend you to study and review on our lesson on Datatypes and Variables (Identifier).
Input
The user is required to enter two (2) inputs where the first input is the student score and the second one is the total number of items.
Output
The program will display the solution or formula (Score / Total # of Items) x 60 + 40 followed by an equal sign then the equivalent laboratory grade with two decimal places of the student. (Refer to the sample output)
Write a complete C++ program with the two alternate functions specified below, of which each simply triples the variable count defined in main. Then compare and contrast the two approaches. These two functions are; a) Function tripleByValue that passes a copy of count by value triples the copy and returns the new value. b) Function tripleByReference that passes count by reference via a reference parameter and triples the original value of count.
GIven a class definition:
class Circle
{
private:
int radius;
public:
Circle (int inputRadius)
{ radius = inputRadius; }
}
Please provide 2 distinct ways to create circle_object with initial radius value = 5.
Explain at least not less than five differences between data-oriented programming and object-oriented programming. In your explanations, include concepts of data-oriented design, object-oriented design, and use at least five examples which should include source codes to support your arguments.
Explain complement arithmetic and its significance in the computation