An automobile insurance company needs to keep track of information about vehicle policyholders. The company has to store information of customer, car, and accident. Customer information is License no, name and address. Customers can own one or more cars, where the car information is Plate_no, model and year. A car not involved or involved in many accidents. If the car is involved in an accident the information that will be stored is Report_number, location, and date. Each car that is involved in accident the damage amount will be estimate.
Draw the ERD.
For each pair of sentences, identify entities and the relationship representing the sentences.
“Each Student must take one or more Modules”
“Each Module must be taken by one or more Students”
“Each Customer must receive at least one Delivery”
“Each Delivery must be for only one Customer”
“A Client my have an Account Manager”
“Each Account Manager has only one Client”
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.
Years, Weeks & Days
Given
N number of days as input, write a program to convert N number of days to years (Y), weeks (W) and days (D).
Note: Take 1 year = 365 days.
Input
The input contains single integer
N.
Output
Print space-separated integers
Y, W and D.
Explanation
Given
N = 1329. The value can be written as
1329 = 3 years + 33 weeks + 3 days
So the output should be
3 33 3.
Sample Input 1
1329
Sample Output 1
3
33
3
Sample Input 2
0
Sample Output 2
0
0
0Elements in the Range
You are given three numbers. Check if any of the numbers exist in the range from 10 to 20 (including 10 and 20).
Input
The first, second, and third lines of input are integers.
Output
The output should be either
True or False.
Explanation
Given
a = 2, b = 4, c = 16, 16 is in the range between 10 and 20.
So the output should be
True.
Sample Input 1
2
4
16
Sample Output 1
True
Sample Input 2
2
4
6
Sample Output 2
False
Half String - 2
Write a program that prints the second half of the given input string.
You can assume that the length of the input string will always be an even number.
Input
The first line of input is a string.
Output
The output should be a string.
Explanation
In the given string
messages, the length of the string is 8. The last 4 characters i.e The second half of the string is ages.
So the output should be
ages.
Sample Input 1
messages
Sample Output 1
ages
Sample Input 2
time
Sample Output 2
me
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)
3-digit Armstrong Number
Write a program to check if a given 3-digit number
The first line is an integer
The output should be a single line containing
In the given example
X = 371, The number of digits in 371 is 3. So, 33 + 73 + 13 = 371. Hence,
371 is an Armstrong number.So, the output should be
True.
Sample Input 1
371
Sample Output 1
True
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.