Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program that requires users to enter student marks, then display the grades according to the conditions as follows:

    Marks = 100, Grade = A+

    Marks >= 90, Grade = A

    Marks >= 80, Grade = B

    Marks >= 70, Grade = C

    Marks >= 60, Grade = D

    Marks < 60, Grade = F



Draw a series of variable diagrams for the program below using the conventions of the Study Guide. Assume that the following input is given: 2010 t 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 int year; char code; 7 bool book = true; float discount = 0.20; 8 cin >> year >> code; 9 switch (year) 10 { 11 case 2008: case 2009: 12 if (code == 'c') 13 if (!book) 14 discount += 0.20; 15 break; 16 case 2010: 17 if (book) 18 if (code == 't') 19 { 20 book = false; 21 code = 'g'; 22 } 23 case 2011: 24 if (discount > 0.20 || code == 'g') 25 discount = 0.15; 26 else 27 discount += 0.10; 28 default: 29 discount = 0.25; 30 code = 'b'; 31 book = true; 32 } 33 discount = 0.35; 34 cout << year << " " << code << " " << book << " " << discount << endl; 35 return 0; 36 }


Rotate Matrix Rings

Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring.

Input


The first line of input will be two space-separated integers, denoting the M and N.

The next M lines will contain N space-separated integers.

The next line will contain an integer, denoting K.

Output

The output should be M*N matrix by rotating the matrix by K elements.

Explanation

Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be

4 8 12 16

3 10 6 15

2 7 11 14

1 5 9 13

Sample Input 1

4 4

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

3


Sample Output 1

13 9 5 1

14 7 11 2

15 6 10 3

16 12 8 4


Sample Input 2

3 4

1 2 3 4

10 11 12 5

9 8 7 6

2

Sample Output 2

9 10 1 2

8 11 12 3

7 6 5 4


The following incomplete program first asks the user to enter the number of items he/she has eaten today and then to enter the number of calories for each item. It then calculates the number of calories he/she has eaten for the day and displays the value. #include using namespace std; int main() { int numberOfItems; int count; //loop counter for the loop int caloriesForItem; int totalCalories; cout << "How many items did you eat today? "; cin >> numberOfItems; cout << "Enter the number of calories in each of the " << numberOfItems << " items eaten: " << endl; // ------------- Your code -------------- cout << "Total calories eaten today = " << totalCalories; return 0; }.complete the code.complete use a for loop to read in the calories of all the items. Test your program by entering 7 for the number of items and the following values for the calories: 7 120 60 150 600 1200 300 200


Write a program that create a model of employee by using Classes, Program should be able to add, delete, modify and View the Record by using member functions.

Program must contain following attributes.

· Name

· Age

· Gender

· Salary

· EmployeeID



Write a program that creates computer model by using Classes, Program should be able to add, delete, modify and View the Record by using member functions.

 Make sure following qualities should be implemented.

· Manufacture

· Type

· Capacity


Vertical Printing

You are given a string(S) with multiple words in it. Return all the words vertically in the same order in which they appear in S.


Complete with spaces when it is necessary while forming the words vertically. (Trailing spaces are not allowed).


Note: All characters in S are upper case.


Input

The first line contains a string S.


Output

Each line of the output contains a string formed vertically as mentioned above.


Explanation

Given S = CAT BAT VIN.


We are expected to print the words vertically such that considering the ith letter in each line of the output will form the ith word in the given input.


Printing the given words vertically


Joining all the first characters from the 3 lines of output gives CAT.

Joining all the second characters from the 3 lines of output gives BAT.

Joining all the third characters from the 3 lines of output gives VIN.


Sample Input 1

CAT BAT VIN

Sample Output 1

CBV

AAI

TTN

Sample Input 2

MAM BY DORM

Sample Output 2

MBD

AYO

M R

M


Smaller Scores

A group of people(P) are playing an online game. Their scores are stored in the order of their entry time in S. Each integer S[i] corresponds to the score of the person Pi.


For each person Pi you have to report the number of people who played after the person and scored less than the person.


Input

The first line contains a single integer N.

The second line contains N space-separated


Output

The output should contain N space-separated integers representing the number of people who played after the person and scored less than the person.


Explanation

Given S = 13 12 11


Score of P1 is 13.

Score of P2 is 12.

Score of P3 is 11.


The number of people who played after P1 and scored less than 13 is 2(12, 11).

The number of people who played after P2 and scored less than 12 is 1(11).

The number of people who played after P3 and scored less than 11 is 0.


The output is 2 1 0.


Sample Input 1

3

13 12 11

Sample Output 1

2 1 0

Sample Input 2

4

4 3 5 2

Sample Output 2

2 1 1 0


Largest Missing Negative Number


You are given an unsorted array A of N integers. You have to find


the largest negative integer missing from the array.


Input


The first line contains N space-separated integers of A


Output


The output contains N space-separated integers representing the number of people as mentioned above.


Explanation


Given A-2-1012


The largest negative number missing is 3


Sample Input 1

-2 -1 0 1 2

Sample output 2

-3

sample input 2

-11 -10 -12

Sample output 2

-1


What is the process of creating, arranging and maintaining a system of information retrieval called?


LATEST TUTORIALS
APPROVED BY CLIENTS