In: Finance
Write a C++ program that outputs to a file, final marks and average mark for a primary school class. Your program should also output to a second a file, the student names and their average mark in ascending order. This is an example of how your program in action could look like: Sample Input Please enter student name and student number Kgosi Kgosi 20150986 Please student marks for Setswana, Maths, Science, English, and Social Studies 80 70 80 65 100 Please enter any comments about the Student Sample Output First File *************************************Report************************************************* Student Name: Kgosi Kgosi Student Number: 20150986 Course Name Marks % Letter Grade Setswana 80 A - Maths 70 B Science 80 AEnglish 65 B - Social Studies 100 A+ Average: 79 Excellent Comments: **************************************************************************************************** Page 3 of 4 The program should also generate a second file listing all students and their average mark. The list of students should be arranged according to their marks in descending order. Sample Output Second File Kgosi Kgosi 79 Masego Ndi 59 Des Rinn 23
In: Computer Science
An uncharged capacitor is connected to the terminals of a 4.0 V battery, and 12 micro C flows to the positive plate. The 4.0 V battery is then disconnected and replaced with a 5.0 V battery, with the positive and negative terminals connected in the same manner as before. How much additional charge flows to the positive plate?
In: Physics
-0.85306x ''+ 0.08391a ''- 21.149x '- 0.444a' = V
0.399483x'' – 0.10241a'' - 21.149x'' – 0.444a' + 3.91892a= V
In: Electrical Engineering
ART
What are some of the roles of photographers shown below and the functions that photography serves in the world?
* John Humbles (https://www.youtube.com/watch?v=6d97X9sE4MQ)
* Vik Muniz (https://www.youtube.com/watch?v=dTDNlD6yMxo)
*Ansel Adams (https://www.youtube.com/watch?time_continue=80&v=n-ZCEXWdIMg)
In: Psychology
The following questions are on recursion in C++ Programming.
I had some trouble with these questions, can you please help me? Thank you!
Consider the following recursive function
void funcEx8(int u, char v) //Line 1
{ //Line 2
if (u == 0) //Line 3
cout << u << " "; //Line 4
else //Line 5
{ //Line 6
int x = static_cast (v); //Line 7
if (v < 'A') //Line 8
v = static_cast (x + 1); //Line 9
else if (v > 'Z') //Line 10
v = static_cast (x - 1); //Line 11
cout << v << " "; //Line 12
funcEx8(u - 2, v); //Line 13 }
//Line 14 }
//Line 15 }
Identify the base case? Using line numbers
| a. |
Lines 3,4 |
|
| b. |
Lines 1 through 4 |
|
| c. |
Lines 7,8 |
|
| d. |
Lines 5,6 |
Consider the following recursive function
void funcEx8(int u, char v) //Line 1
{ //Line 2
if (u == 0) //Line 3
cout << u << " "; //Line 4
else //Line 5
{ //Line 6
int x = static_cast (v); //Line 7
if (v < 'A') //Line 8
v = static_cast (x + 1); //Line 9
else if (v > 'Z') //Line 10
v = static_cast (x - 1); //Line 11
cout << v << " "; //Line 12
funcEx8(u - 2, v); //Line 13 }
//Line 14 }
//Line 15 }
Identify the Recursive case? Using line numbers
| a. |
Lines 5 Through 15 |
|
| b. |
Lines 3,4 |
|
| c. |
1,2 |
|
| d. |
Lines 2,3 |
Consider the following recursive function
void funcEx8(int u, char v) //Line 1
{ //Line 2
if (u == 0) //Line 3
cout << u << " "; //Line 4
else //Line 5
{ //Line 6
int x = static_cast (v); //Line 7
if (v < 'A') //Line 8
v = static_cast (x + 1); //Line 9
else if (v > 'Z') //Line 10
v = static_cast (x - 1); //Line 11
cout << v << " "; //Line 12
funcEx8(u - 2, v); //Line 13 }
//Line 14 }
//Line 15 }
Valid or Invalid
funcEx8(26, '$'); is a valid call,
| a. |
None |
|
| b. |
Yes and No |
|
| c. |
No |
|
| d. |
Yes |
Consider the following recursive function:
void recFun(int u)
{
if (u == 0) cout << "Zero! ";
else
{
cout << "Negative ";
recFun(u + 1);
}
}
what is the output if recFun(8)
| a. |
Infinite loop, nonegative |
|
| b. |
5 |
|
| c. |
0 |
|
| d. |
8 |
Consider the following recursive function:
void recFun(int u)
{
if (u == 0) cout << "Zero! ";
else
{
cout << "Negative ";
recFun(u + 1);
}
}
. what is the output if recFun(0)
| a. |
12 |
|
| b. |
infinite loop |
|
| c. |
8 |
|
| d. |
zero |
Consider the following recursive function:
void recFun(int u)
{
if (u == 0) cout << "Zero! ";
else
{
cout << "Negative ";
recFun(u + 1);
}
}
. what is the output if recFun(-2)
| a. |
8 |
|
| b. |
Negative Negative Zero! |
|
| c. |
-2 |
|
| d. |
zero |
Consider the following recursive function:
void recFun(int x)
{
if (x > 0)
{ cout << x % 10 << " ";
recFun(x / 10);
}
else
if (x != 0)
cout << x << endl;
}
what is the output of the above statement if recFun(258)?
| a. |
12 |
|
| b. |
3 4 6 |
|
| c. |
15 |
|
| d. |
8 5 2 |
Consider the following recursive function:
void recFun(int x)
{
if (x > 0)
{ cout << x % 10 << " ";
recFun(x / 10);
}
else
if (x != 0)
cout << x << endl;
}
. what is the output of the above statement if recFun(7)?
| a. |
7 |
|
| b. |
8 |
|
| c. |
8 5 2 |
|
| d. |
12 |
Consider the following recursive function:
void recFun(int x)
{
if (x > 0)
{ cout << x % 10 << " ";
recFun(x / 10);
}
else
if (x != 0)
cout << x << endl;
}
what is the output of the above statement if recFun(36)?
| a. |
5 3 8 |
|
| b. |
12 |
|
| c. |
6 3 |
|
| d. |
2 4 5 |
Consider the following recursive function:
void recFun(int x)
{
if (x > 0)
{ cout << x % 10 << " ";
recFun(x / 10);
}
else
if (x != 0)
cout << x << endl;
}
what is the output of the above statement if recFun(-85)?
| a. |
12 |
|
| b. |
-85 |
|
| c. |
8 5 2 |
|
| d. |
85 |
In: Computer Science
There are three vectors in R4 that are linearly independent but not orthogonal: u = (3, -1, 2, 4), v = (-2, 7, 3, 1), and w = (-3, 2, 4, 11). Let W = span {u, v, w}. In addition, vector b = (2, 1, 5, 4) is not in the span of the vectors. Compute the orthogonal projection bˆ of b onto the subspace W in two ways: (1) using the basis {u, v, w} for W, and (2) using an orthogonal basis {u' , v' , w'} obtained from {u, v, w} via the Gram Schmidt process. Finally, explain in a few words why the two answers differ, and explain why only ONE answer is correct.
In: Advanced Math
(a) How many grams of CaCl2 are needed to make 798.0 g of a solution that is 32.5% (m/m) calcium chloride in water? Note that mass is not technically the same thing as weight, but (m/m) has the same meaning as (w/w).
-How many grams of water are needed to make this solution?
(b) What is the volume percent % (v/v) of an alcohol solution made by dissolving 147 mL of isopropyl alcohol in 731 mL of water? (Assume that volumes are additive.)
(c) The mass of solute per 100 mL of solution is abbreviated as % (m/v). (The abbreviation % (w/v) is also common.) How many grams of sucrose are needed to make 915 mL of a 38.0% (w/v) sucrose solution?
In: Chemistry
(a) How many grams of CaCl2 are needed to make 250.9 g of a solution that is 30.5% (m/m) calcium chloride in water? Note that mass is not technically the same thing as weight, but (m/m) has the same meaning as (w/w).
-How many grams of water are needed to make this solution?
(b) What is the volume percent % (v/v) of an alcohol solution made by dissolving 117 mL of isopropyl alcohol in 747 mL of water? (Assume that volumes are additive.)
(c) The mass of solute per 100 mL of solution is abbreviated as % (m/v). (The abbreviation % (w/v) is also common.) How many grams of sucrose are needed to make 735 mL of a 34.0% (w/v) sucrose solution?
In: Chemistry
define U=x+y, V=x-y.
find the joint and marginal pdf of U and V
In: Statistics and Probability