Questions: 9 913

Answers by our 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 & Filtering

C++ code:

Make a recursive function which displays the fibonacci series before a number that is entered by the user.


Requirements:

No global declarations

Test run in main


Diagram:

Also draw diagram to show how the recursive call is working


Write an algorithm, draw a flowchart and write a program code to display 3*3 Identity Matrix.

WAP in C++ :

  • Defines a structure called ThreeDPoint that represents a point in a 3D space. The point has an x , a y , and a z coordinate.
  • Defines a function getPointData() to accept values of x, y and z coordinates of a point from the user.
  • Defines another function for operator overloading of less than (<) operator. The function compares x coordinates of two structure variables and returns true if that of first one is less than that of second. If both are equal, it compares y coordinates of two structure variables and returns true if that of first one is less than that of second. If they are also equal, it compares z coordinates of two structure variables and returns true if that of first one is less than that of second. For example if input values for two points, say p1 and p2 are (1, 1, 2) and (1, 1, 0) then p1 < p2 returns false and p2 < p1 returns true.
  • Define two variables of the structure ThreeDPoint, namely- p1 and p2 in the main() function and print the smaller of the two points.

Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. 

Ex: If the input is: 

-15 10

the output is: 

-15 -10 -5 0 5 10

Ex: If the second integer is less than the first as in:

20 5

the output is:

Second integer can't be less than the first.

For coding simplicity, output a space after every integer, including the last.



Write a c++ program to display the Fibonacci series of the first 50 integer

a. (overSpeed > 10) ? fine = 200 : fine = 75;

b. (fuel >= 10) ? drive = 150 : drive = 30;

c. (bill >= 50.00) ? tip = 0.20 : tip = 0.10;

Que.Define a class Array with one dimensional array of integers and its size as data members.

  • Define a parametrized constructor and a copy constructor to initialize its data members. The parametrized constructor function should accept an array and its size as input parameters.
  • Define a member function to perform operator overloading on the (+)operator to add two objects of the class Array and return a new object of the class Array that contains the sum of corresponding elements of one dimensional array of two objects of class Array.
  • Define a member function void display()to display the object of class Array.

Instead of forcing the user to enter all of the data at once and displaying all of it, the program will provide menu options that allows user to add new records, delete, update and view all records. It should also provide an option called settings that allows the user to set the grading criteria that will be used in the computation of grades. You may include an additional functionality that allows the user to search a specific record of a student given the student number. A sample menu driven application is given below




Mini Grading System



1. Add New Record



2. Edit Record



3. Delete Record



4. View All



5. Settings



6. Search



7. Exit



Enter your choice:

Write a program that takes as input the marks of three tests and computes the total and average marks of the student. The program should also display 'SELECTED FOR NASA TRIP' if the total marks exceeds 250 and 'BETTER LUCK NEXT TIME'

Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least one non-negative integer.

Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.

Ex: When the input is: 

15 20 0 3 -1

the output is: 

20 9.50
LATEST TUTORIALS
APPROVED BY CLIENTS