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

Use Pointer


Write a program that allows the user to enter the last names of a number of candidates in a local election and the


number of votes received by each candidate. The program should then output each candidate’s name, the number of


votes received, and the percentage of the total votes received by the candidate. Your program should also output the


winner of the election. A sample output is:



Number of Candidates: 5


Candidate Votes recieve %of total vote


Johnson 5000 25.91



Miller 4000 20.73



Duffy 6000 31.09



Robinson 2500 12.95



Ashtony 1800 9.33



Total 19300




The winner of the election is Duffy!!



Toll roads have different fees at different times of the day and on weekends. Write a function CalcToll() that has three arguments: the current hour of time (int), whether the time is morning (bool), and whether the day is a weekend (bool). The function returns the correct toll fee (double), based on the chart below.

Weekday Tolls

  • Before 7:00 am ($1.15)
  • 7:00 am to 9:59 am ($2.95)
  • 10:00 am to 2:59 pm ($1.90)
  • 3:00 pm to 7:59 pm ($3.95)
  • Starting 8:00 pm ($1.40)

Weekend Tolls

  • Before 7:00 am ($1.05)
  • 7:00 am to 7:59 pm ($2.15)
  • Starting 8:00 pm ($1.10)

Ex: The function calls below, with the given arguments, will return the following toll fees:

CalcToll(8, true, false) returns 2.95

CalcToll(1, false, false) returns 1.90

CalcToll(3, false, true) returns 2.15

CalcToll(5, true, true) returns 1.05




Instructions:





1. Input a random positive integer. Then, create an integer array with a size the same as the inputted integer.




2. Then, using loops, add random integer values into the array one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.




3. Print out the list's new order in this manner, with each number separated by a space per row:




second-half values




middle value




first-half values




Refer to the sample output for a clearer view on how it is to be printed out.





Input





The first line contains an odd positive integer. It is guaranteed that this integer is greater than or equal to 3.




The next lines contains an integer.





5




1




3




4




5




2





Output





A line containing grouped arrays.





{2,5}-{4}-{3,1}

Write c++ program to implement Recursion, use your names as variable names, by the use of RAM diagrams show demonstration of how these code execute

Receive a number and determine whether it is odd or even.

Receive a number and determine whether it is odd or even.





2. Obtain two numbers from the keyboard, and determine and display which (if either) is the larger of the two numbers.





3. Receive 3 numbers and display them in ascending order from smallest to largest





4. Add the numbers from 1 to 100 and display the sum





5. Add the even numbers between 0 and any positive integer number given by the user.





6. Find the average of two numbers given by the user.





7. Find the average, maximum, minimum, and sum of three numbers given by the user.





8. Find the area of a circle where the radius is provided by the user.





9. Swap the contents of two variables using a third variable.





10. Swap the content of two variables without using a third variable.





11. Read an integer value from the keyboard and display a message indicating if this number is odd or even.





12. read 10 integers from the keyboard in the range 0 - 100, and count how many of them are larger than 50, and display this result







A C++ program to print the area of a rectangle by creating a class named Area having two functions, first function named as Setdim takes the length and width of rectangle as parameters and second function named as getArea returns the area of the rectangle, length and width are entered through keyboard.

The function below calculates and returns the sum of integers between 1 and n (inclusive) where n is an integer accepted by the function i.e.

If n = 3;

then the function returns 6 (1+2+3). int sum(int n) { int sum = 0;

while (n > 0) { sum = sum + n; --n; } return sum;

}


Rewrite the body of the sum function using a single do-while loop instead of a while-loop


Write a C++ program that accepts an input value in Tambala from the user and

then the program should convert the value to equivalent value in Kwacha and

Tambala.

(For example, if the user enters 112 as input value, the program should display:

1 Kwacha and 12 tambala


short and simple Login system using inheritance (any type of Inheritance) in c++ according to OOP concepts.

Thanks.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS