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 simulates a lottery. The program should have an array of five integers named lottery and should generate a random number in the range of 0 through 9 for each element in the array.

The user should enter five digits, which should be stored in an integer array named user. The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example, the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4).

lottery array: 7 4 9 1 3

user array: 4 2 9 7 3


The program should display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, display a message proclaiming the user as a grand prize winner.


Input Validation: Do not accept a negative value for lottery number. Also keep track of array size.



Bank charges $10 per month plus the following check fees for a commercial checking account:

 $.10 each for fewer than 20 checks

$.08 each for 20–39 checks

$.06 each for 40–59 checks

$.04 each for 60 or more checks

The bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied).

 Write a program that asks for the beginning balance and the number of checks written.

Compute and display the bank’s service fees for the month (30 days).

Input Validation: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.



Write a program that displays the following menu:

Geometry Calculator

1. Calculate the Area of a Circle

2. Calculate the Area of a Rectangle

3. Calculate the Area of a Triangle

4. Quit

Enter your choice (1-4):

If the user enters 1, the program should ask for the radius of the circle and then display its area. formula: area π r 2 Use 3.14159 for π and the radius of the circle for r.

If the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. formula: area = length * width

 If the user enters 3 the program should ask for the length of the triangle’s base and its height, and then display its area. formula: area = base * height * .5

If the user enters 4, the program should end.

Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. Do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height.  



What is the output of the following C++ statements?

 a. cout << "C++ is a high level language." << endl; 

b. cout << "Enter the distance traveled: " << endl;

 c. cout << "The difference of 7 and 3 = " << 7 - 3 << endl;


Write simple program using if-else statement  

Write a C program which reads and access the elements of the csv file by using the system call functions such as read, write and open. You should sum all the no. present inside a particular column in that csv file by using the words pthread_create and pthread_join only .


Outline THREE challenges when implementing C++ applications


Using code block/Dev C++, write any TWO types of operators program separately

Identify errors in the following code and rewrite.Attach output in screenshot form

#include 

#include void sum()

; // declaring a function

 int a=10

b=20

 c; 

void sum()

 // defining function 

{

 c=a+b;

 cout<<"Sum: "<





You have to make report card of a student including his bio-data (Name, AGE, Class), subject marks

(English, Urdu, Science, Pakistan Studies, Arts), percentage and grade. Grade specifications are as

follows

= &gt; 80% A+ Grade

= &gt; 70% &amp; &lt; 80 A Grade

= &gt; 60% &amp; &lt;70 B Grade

= &gt; 50 &amp; &lt; 60 C Grade

&lt; 50 Fail


LATEST TUTORIALS
APPROVED BY CLIENTS