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

Start with a program that allows the user to input a number of integers, and then stores
them in an int array. Write a function called maxint() that goes through the array,
element by element, looking for the largest one. The function should take as arguments
the address of the array and the number of elements in it, and return the index number of
the largest element. The program should call this function and then display the largest
element and its index number.
Write a program that calculates the average of up to 100 English distances input by the
user. Create an array of objects of the Distance class, as in the ENGLARAY example . To calculate the average, you can borrow the add_dist() member function
from the ENGLCON example . You’ll also need a member function that divides
a Distance value by an integer. Here’s one possibility:
void Distance::div_dist(Distance d2, int divisor)
{
float fltfeet = d2.feet + d2.inches/12.0;
fltfeet /= divisor;
feet = int(fltfeet);
inches = (fltfeet-feet) * 12.0;
}
Create a class called employee that contains a name (an object of class string) and an
employee number (type long). Include a member function called getdata() to get data
from the user for insertion into the object, and another function called putdata() to
display the data. Assume the name has no embedded blanks.
Write a main() program to exercise this class. It should create an array of type employee,
and then invite the user to input data for up to 100 employees. Finally, it should print out
the data for all the employees.
Write a function called reversit() that reverses a C-string (an array of char). Use a for
loop that swaps the first and last characters, then the second and next-to-last characters,
and so on. The string should be passed to reversit() as an argument.
Write a program to exercise reversit(). The program should get a string from the user,
call reversit(), and print out the result. Use an input method that allows embedded
blanks. Test the program with Napoleon’s famous phrase, “Able was I ere I saw Elba.”

define a class length with feet (int type )and (float type) data members.define do-nothing constructor


Create a C++ Program that will identify the Discount Rate of a shopper based on issued loyalty card, take the following conditions:

Loyalty Card TypeDiscount (%)(1) Frequent Buyer10%(2) One Time Buyer0%(3) Senior Citizen15%

This should be the outcome if ever we run the program

Example:

Total Purchase Cost: Php 3000.00

Loyalty Card Type: 1

Discounted Cost: Php 2700.00

1, For each loop with example

2, do while loop with example


Two cars A and B leave an intersection at the same time. Car A travels west at an average speed of x


miles per hour and car B travels south at an average speed of y miles per hour. Write a program that


prompts the user to enter the average speed of both the cars and the elapsed time (in seconds) and


outputs the total distance each car has traveled as well as the shortest distance between the cars.


Output data MUST be rounded to 2 decimal places and have precision set so that all data is evenly lined


up. For simplicity, assume that decimal numbers will be no more than 8 digits long.



Decision and repetition statement with example

1,If statement

2,switch statement

3,for loop,for each loop

4,while loop, do while loop


You are to write a code that simulates the working of a Cosmetic Store which has a small sales team.
The store pays commissions to each member of its sales team every six months. The commission is
based on the total sales generated by each employee and their position in the company. You need to
design a code that calculates and compares the commissions earned by every member of the sales
team and also clearly identifies the sales team member earning the highest commissions.
LATEST TUTORIALS
APPROVED BY CLIENTS