Define a struct , FruitType, to store the following data about a fruit: Fruit name (string), color (string), fat (int), sugar ( int ), and carbohydrate (int). Now write a program that implements the struct FruitType, then include two functions. One function must ask the user to input the data about the fruit. The other function must output the data bout the fruit.
The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.
1. Declare a const named CENTS_PER_POUND and initialize with 25.
2. Get the shipping weight from user input storing the weight into shipWeightPounds.
3. Using FLAT_FEE_CENTS and CENTS_PER_POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.
Addition of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., “1203009954” and
“109876201453”) from the user and add these two numbers and store answer in a third char array
digit by digit (“111079211407”).
function prototyoe:char* additionOfBigInteger(char * Num1, char* Num2)
Subtraction of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., and “1203009954”
“109876201453”) from the user and subtract these two numbers and store answer in a third char
array digit by digit (“-108673191499”).
function prototyoe:char* subtractionOfBigInteger(char * Num1, char* Num2)
Multiplication of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., and “1203009954”
“109876201453”) from the user and multiply these two numbers and store answer in a third char array digit by digit (“132182164055668263162”).
function prototyoe:char* multiplicationOfBigInteger(char * Num1, char* Num2)
Write a program that will get the average of all integers from 1 to 20 using do-while loop
Write a generic C++ recursive function PrintPattern2 to print diamond pattern using recursion. No loops allowed whatsoever, and you can write other helping (recursive) functions. For example, calling your function with these argument PrintPattern2(5,1,5) should print following pattern.
Your function prototype must be as follows:
void PrintPattern2(int, int ,int);
Write a program that takes a 2D pointer array and calculate sum of even and odd using recursive
function.
int sum(int **array, int row, int column, int &evenSum, int &oddSum)
Given a string, write a recursive function to find its first uppercase letter. Your function should
return the letter.
Function Prototype: char findUppercase(char* str);
How to execute this using vector
#include <iostream>
int main() {
int size, index, largest, smallest;
std::cout << "How many intergers you want to input? ";
std::cin >> size;
int myarray[size];
std::cout << "Input the elements of the array: ";
for (index = 0; index < size; index++)
std::cin >> myarray[index];
largest = myarray[0];
smallest = myarray[0];
for (index = 0; index < size; index++) {
// largest
if (myarray[index] > largest)
largest = myarray[index];
// smallest
if (myarray[index] < smallest)
smallest = myarray[index];
}
std::cout << "The largest element in the array is: " << largest << ".\n";
std::cout << "The smallest element in the array is: " << smallest << ".\n";
return 0;
}
Write a program that will get the average of all integers from 1 to 20 using do while loop.
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.