Questions: 11 448

Answers by our Experts: 10 707

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 class with name “STRING”.Assume only studio.h library is included and it is not possible to include any other library. In PRIVATE section of class there will be a character array (lets say S) and also it is possible to locate functions to this section that you want to use but not asked. In public section there will be five functions.

  1. ”set” function will take a character array as parameter and assign it to ‘S’
  2. ’print’ function will just print ‘S’ on screen
  3. ’count’ function will take character as parameter and count the first appearance of that character by counting from right and return this count number
  4. ’show’ function prints consonants in ‘S’ on screen (vowels : i,o,u,e,a)
  5. prefix - - operator will delete the first character of ‘S’

Write a program to initialize 4 integer numbers. Calculate Sum and Print it.

A student did 8 units in an exam and got different marks in each of the exam papers. He intends to calculate his total, mean score and exams decision for the exams using a program written in C++.

i. Assign 8 scores to the student in a one-dimensional array.

ii. Declare a function that takes an array of the student’s scores as a parameter and calculates both the total and the mean score.

iii. Pass the mean score from (ii) above into another function by reference, that computes whether the student has passed or not given that a pass is 50 – 100 while a fail is 0 – 49.99

Write a C++ program that will compute the above.


Write run a program in C/C++ to simulate the behavior of Aloha random access protocol and

show the output.

You are required to the following tasks:

• Generate packets randomly

• Simulate transfer of packets at a random time

• Simulate the occurrence of collision of packets

• Calculate throughput of Aloha

• Plot throughput Vs Load graph 


Write a C++ one dimensional array program that prompts and reads in the sales for each salespeople(number of salespeople are 5 and each salespeople name should be stored) for each category(viz.. Living,bed,dining,office,decor) in a company. Then prints out the salespeople's name and amount of sales for each category and their respective total sales.

a.  Each salespeople's total sale should be stored and cumulatively added everytime the program runs.

b.  also overall sale(sum of every salespeople's total sales) should be displayed and stored and should also be cumulatively added everytime the program runs.



Let us now try comparing two numbers by letting the user input two different numbers and say "Greater" if the first inputted number is greater than the second one, and "Lesser" if it’s the other way around.






Let's go!




Input




A line containing two different numbers separated by a space.




1.2·1.02




Output




A line containing a string.




Greater

Write a program which can read your name (separated by a space), and ensures that all the letters are capital (replacing the small letters with capital letters). In the presence of characters that do not belong to the alphabet (ä, ü ... 1, 2, ..., $, #, ...), the program returns an error message. indications: - You declare a string of character size 20: (char string [20];) - Note the difference between (scanf ( "% s", &string);) a (gets (string);) at the reading of a string that contains a space. - You can add the instruction (fflush(stdin);) That can empty the buffer in case of multiple readings. - To go from "a" to "A", we must subtract 32 ASCII (97-32 = 65). - chain [i-1] is the ith character of the string. - A string ends with the character '\0'



you own a club on eerie planet. the day on this planet comprises of h hours. you appointed c crew members to handle the huge crowd that you get, being the best club on the planet. each member of the crew has fixed number of duty hours to work. there can be multiple or no crew members at work at any given hour of the day. being on weird planet, the rules of this club cannot be normal. each member of the crew only allows people who are taller than him to enter the club when he is at work. given the schedule of work and heights of the crew members, you have to answer q queries. each query specifies the time of entry and height of a person who is visiting the club. you have to answer if the person will be allowed to enter the club or not.

In the following code snippet what type of variable is y

Inylt main()

{

Intex=50;

Int&y=x;

cout<<y<<" "<<x;



}


Write a program that accepts grade as input from the user and stores these grades in twodimensional array with dimension of 5 rows and by 5 columns. Then count the number of grades that


passed and the number of grades that failed. Grade that pass must be greater or to equal to 80.



Sample Program:


Enter the grades: 90 95 78 89 88 71 72 79 81 82 77 74 78 88 91 73 77 75 84 98 76


89 71 87 73 79



There are 12 that passed.


There are 13 that failed.

LATEST TUTORIALS
APPROVED BY CLIENTS