Diamond
Given an integer value
The first line of input is an integer
In the given example, the number of rows in the diamond is
5.So, the output should be
....0....
...000...
..00000..
.0000000.
000000000
.0000000.
..00000..
...000...
....0....
Let G(x) = x5 + x4 + x2 + 1 be the polynomial generator(pattern), T = 101000110101110 be the message received by the destination node. Would the receiver accept the message? Why?
Write a program that accepts dates written in numerical form and outputs in complete form
class List{
public:
int item;
int pos;
List* nextNode;
};
Task:
1)create the following functions
void Insert_Element_at(int X, int pos),
bool Delete_Element(int X),
bool is_Empty()
void Empty_List(),
void Copy_List(…)
2)Call the functions in main by makeing menu for them using switch_case statement and while loop.
Digit 9
You are given
The first line of input is an integer
In the given example,
N = 4.So, the output should be
* * * *
* *
* *
* * * *
*
*
* * * *
Sample Input 1
4
Sample Output 1
* * * *
* *
* *
* * * *
*
*
* * * *
Sample Input 2
5
Sample Output 2
* * * * *
* *
* *
* *
* * * * *
*
*
*
* * * * *
Write a C++ program to check for the not-eligible donor by throwing a custom exception.
The class Donor has the following protected variables.
Data TypeVariablestringnameintageintweightstringbloodGroup
In the Donor class, define the following function.
MethodDescriptionbool validateDonor(Donor donor)This method validates donor eligibility. Validate the donor details with the following conditions.
1.Age must be greater than 30 then the donor is eligible.
2.If the age is less than 30 then throw an exception and check the weight should be greater than 44 kg in catch block,
If the weight is also less than 44 then the donor is not eligible and rethrow the exception to the main method.
If the weight is greater than 44 then the donor is eligible.
In the Main method, read the donor details from the user and create corresponding objects.
Validate the donor to check the donor is eligible or not.
Create a program that takes in a student’s full names and marks for 3 In-class exercises, then calculate the average of this marks. This average mark is then categorized as follows: Marks obtained Grade Level Message 80 – 100 1 Magnificent!! 70 – 79 2 Excellent!! 60 – 69 3 Good work!! 50 – 59 4 Good!! 2 DUE DATE: MONDAY 06 OCTOBER 2021 BEFORE 23h59 0 – 49 0 Fail – Try again next Year!! Greater than 100 or less than 0 X Invalid Marks!!, Marks too high. Or Invalid Marks!!, Negative marks not allowed. Sample run 1: Enter student full names: Goodluck Johnathan Enter 3 marks separated by spaces: 78 94.6 88 Output: Student name: Goodluck Johnathan Grade Level: 1 Comment: Magnificent!! Sample run 2: Enter student full names: Ellen Johnson Sirleaf Enter 3 marks separated by spaces: 200 104.87 99.9 Output: Student name: Ellen Johnson Sirleaf Grade Level: X Comment: Invalid Marks!!, Marks too high.
Create a program that takes in two words, check for equality ignoring the cases, if the words are equal the print the word in upper case with an appropriate message however if the words are different then print the two words in lower case with an appropriate message. Sample run 1: Enter two words separated by spaces: Welcome WELCOME Output: You have only entered one word: “WELCOME” Sample run 2: Enter two words separated by spaces: NUST Students Output: You have entered two words: “nust” and “students”