Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working.
Write a program that will get the average of all integers from 1 to 20 using do while loop.
Write a circle class with a private data member that is the radius (r) of the circle, and a parameterized
constructor that sets the value of the radius (r). In addition, the class includes common methods, such as
calculating the circumference of a circle, calculating the area of a circle, and getting the radius of a circle.
Enter the radius of the circle in the console to calculate and show the circumference and area of the circle.
TCP/IP is a condensed representation of the OSI paradigm. It has four layers,
as opposed to the OSI model's seven. What if the INTERNET
LAYER, or the third layer, were to be replaced by the LINK LAYER, or the fourth layer,
and vice versa? . What impact will this have on the packets being
sent from source to destination? Make a list of the potential problems that may arise
during communication. Simply by stating that no communication will be possible, this
kind of answer will not be acceptable
create a C++ program for them. Your program should do the following:
1. Read student information for 20 semester 1 students. The student information includes the following:
a) Student name
b) Student surname
c) Student id
d) Program
e) Module code
f) Test one mark
g) Test two mark
h) Project mark
i) Tutorials mark
LIMKOKWING
UNIVERSITY
CREATIVE
j) Final exam mark
2. For the following use functions.
a) Calculate and return the final mark for each student.
Final mark = 10% testl + 15% test2 + 15% tutorial + 20% project +
40% exam
b) Determine the grade using the final mark.
Final mark Grade
80 - 100
70 - 79
60 - 69 c o - 59
40 — 49
30-39 F
c) Find the highest and lowest mark.
d) Find the class average mark.
3. Your program should ask the user if he or she wants a class report or an individual report.
Machine Exercise # 1 : Arrays and Strings
Write a program that uses a 3 3 3 array and randomly place each integer from 1 to 9 into the
nine squares. The program calculates the magic number by adding all the numbers in the array
and then dividing the sum by 3. The 3 3 3 array is a magic square if the sum of each row, each
column, and each diagonal is equal to the magic number. Your program must contain at least
the following functions: a function to randomly fill the array with the numbers and a function to
determine if the array is a magic square. Run these functions for some large number of times,
say 1,000, 10,000, or 1,000,000, and see the number of times the array is a magic square.
NOTE : SUBMISSION IN CPP FORMAT
For the experiment Taru has N buckets (numbered from 1,2,3..N) which all are initially empty. She has M number of queries. Each query represents an integer that is of 4 types. Query 1: Fill all the buckets with water •Query 2: Empre even valued buckets (2, 4, 6 N) Query 3: Empty all odd number buckets (1, 3, 5, N). •Query 4: Empty all the buckets (1,2,3. N). You have to return the number of buckets that are filled after performing M queries,using fillbucket function
given the following code what is the value of cities[3]
String cities[] = new String[5];
cities[0] = "North bay";
cities[1] = "Windsor";
cities[2] = "Kitchener";
cities[3] = "Kingston";
cities[4] = "Ottawa";
Given the following How many elements are in the array die3
int die1[] = {1,0,2,0,3,1};
int die2[] = {2,1,0,4,0,3};
int die3[] = {3,0,3,0,3,4};
int die4[] = {2,0,1,0,3,5};
int die5[] = {1,0,2,0,3,4};
int die6[] = {4,0,1,2,3,2};
int dice[][] = {die1,die2,die3,die4,die5,die6};
How to execute this using vector
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int fibo(int n);
int main() {
string header = " Index Fibonacci number Fibonacci quotient Deviation";
double lim = (1.0 + sqrt(5.0)) / 2.0;
int fib_sequence[21];
for (short i = 0; i < 21; i++) {
fib_sequence[i] = fibo(i);
}
cout << header << endl;
for (short i = 0; i < 20; i++) {
double q = (double)fib_sequence[i + 1] / (double)fib_sequence[i];
cout << setw(5) << i << setw(15) << fib_sequence[i] << setw(20) << fixed
<< setprecision(10) << q << setw(20) << scientific << setprecision(3)
<< lim - q << endl;
}
return 0;
}
int fibo(int n) {
if (n <= 1)
return n;
return fibo(n - 1) + fibo(n - 2);
}