Solve for the Greatest Common Divisor (GCD) of the following pair of numbers using the Pseudocode of Euclidean Algorithm given
below. (Show your complete solution.)
while n ≠ 0 do
r ← m mod n
m ← n
n ← r
return m
1. GCD (248, 16)
Solve for the Greatest Common Divisor (GCD) of the following pair of numbers using the Basic Euclidean Algorithm. (Show your complete solution.) 1. GCD (700, 105)
1. Write C++ program, overload the unary decrement operator (--) , postix nd prefix
2. Write C++ program , overload the binary subtraction operator(-)
Les assume you create a system which asks the user for the number of students and the
number of test scores per student. A nested inner loop, should ask for all the test scores for one
student, iterating once for each test score. The outer loop should iterate once for each student
and take student name as input. After taking input for 3 test scores, calculate average for each
student. Take 3 test scores and 4 students.
Note: use do-while loops
by CodeChum Admin
We all know what man's best friend is. A dog! 🐶
Let's create one in our program using the pre-existing struct Dog provided.
Instructions:
We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.
Care to do it for me?
Input
A line containing two integers seperated by a space
Output
A single line containing an integer
1
Create Class (PSL), having
1. Data items: M , W , L, T, P
2. Constructors: Defualt, Parameterized, Copy
3. Member functions: getdata(), setData(), showdata() const
4. Static class data: total number of teams (objects) created
5. Constant Object : e.g LQ
Lets assume you create a system which asks the user for the number of students and the number of test scores per student. A nested inner loop, should ask for all the test scores for one student, iterating once for each test score. The outer loop should iterate once for each student and take student name as input. After taking input for 3 test scores, calculate average for each student. Take 3 test scores and 4 students.
Note: use do-while loops
A certain charity designates donors who give $10,000.00 or more as
Benefactors; those who give $1,000.00 or more but less than $10,000.00 as
Patrons; those who give $200.00 or more but less than $1,000.00 as Supporters;
those who give $15.00 but less than $200.00 as Friends; and those who give
less than $15 as Cheapskates.
Write a program containing a nested if-else statement (or statements) that,
given a keyboard input with the amount of a contribution, outputs the correct
designation for that contributor.
Here’s an example that illustrates what your program should look like in
action:
~/ python donor.py
Enter the amount of a contribution: $5.20
Cheapskate!
Test your program also for the input values: 10000.00, 1000.00,
999.99, 12200.00,15.00, 499.99, 2200.00, 199.99, 75.33
An appropriate error message should be output (and your program should halt) when
an amount less than 0 is input.
Consider a scenario where a “Class A” network is divided into 7 subnets of fixed length.
Design each subnet and find the IP Range and subnet mask of each subnet. (Choose any class-
A address). (5 marks)
Q3.2: A sender needs to send the two data items 010011 and 010110, find the checksum at
sender and receiver to check if there is any error or not? (5 marks)