C++ Answers

Questions answered by Experts: 9 913

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

Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3.


Your code will be tested with the following values:

matchValue: 2, userValues: {2, 1, 2, 2} (as in the example program above)

matchValue: 0, userValues: {0, 0, 0, 0}

matchValue: 10, userValues: {20, 50, 70, 100}


Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:

7 9 11 10 
10 11 9 7 

Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime = {800, 775, 790, 805, 808}, print:

800 
775 
790

If you wanted your loop’s control variable to start at 100 and terminate when it becomes 3, which syntax should be used?

Select one:

a.

for(int i = 100; i < 3; i++) {}

b.

for(int i = 0; i < 100; i+3) {}

c.

for(int i = 3; i > 100; i--) {}

d.

for(int i = 100; i >= 3; i--) { }


The Chemistry department has 4 computers, the Physics department has 8, the English de-

partment has 2, and the Math lab has 12. Write a program that produces the following out-

put. Have the computer perform the calculation in the last line. Format the output using the

appropriate escape sequences.


Write a function to sort an array consists

of 10 integer numbers in descending order,

print the array before sorting and after

sorting.


Write a program to sort an array consists

of 10 integer numbers in ascending order,

print the array before sorting and after

sorting.


1-Write a C++ program that delete the 5th

element from the following list

{1, 5, 4, 7, 10, 50, 21, 24}


Construct an ADT (any of your choice but make it unique) with appropriate data members and member functions (CRUD for now). Your implementation will be purely abstraction based i.e. you will make separate files for header, implementation and driver class. In your driver class you will have a list corresponding to the ADT. You will test your program for all list operations.

 

develop a new system to help farmers manage their poultry farm. The system must be tailored to the farmers and be very easy to use.






document all the necessary requirements.





write a program that will fulfil all the requirements of a poultry farming business.





Below are some ideas to help you with the requirements and developing of the software.






The program should help the farmer with:







 Inventory control







o The birds







o Feed







o Chemicals







o Equipment







(Provide options for the farmer to choose the correct inventory module)







 Payroll







o Help farmer calculate the pay for its employees with provident fund deductions






(10% employee and 8% employer contribution)







o Pay should be calculated on individual basis (with all necessary data)







o Employees are paid every week







 Calculate the profit and loss after identifying at least 8 general expenses that occur







every month.







o Consider revenue from:







 Sale of chicken

LATEST TUTORIALS
APPROVED BY CLIENTS