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

Write a C++ program that converts a decimal number to a binary, octal, and hexadecimal equivalents. First, the program will ask to fix a range for the lower and upper limit in which the conversion is required. The lower limit should not be less than 0 and greater than the upper limit. For example, if you enter a negative number or greater than the upper limit, then the program should print a message for the invalid input and will ask you again to enter a decimal number within the range. If you correctly specify the upper and lower limits, then the program will print a table of the binary, octal and hexadecimal equivalents of the decimal numbers in the range of lower limit through upper limit.

1. Create a 'for' loop that will display numbers: 100 90 80 70 60

2. Create a 'for' loop that will display all EVEN numbers from 1 to N. (N is a positive number entered by the user.)

3. Create a 'while' loop that will accept numbers but stops when it encounters a negative number.


There are 15 students in the class. Students had their mid term result



in INT105 and teacher from CSE domain wants to find the average



marks of the class for course code INT105 and display it. Write a



program using C++ programming language that consists of an class



having name Student containing one integer array data member which



stores the total marks of 15 students and float data member that



calculate the stores average marks to 10 students. Use constructor to



initialize data members and member functions to calculate and display



average marks.

using dev c++ please

(Hardware Inventory) You are the owner of the hardware store and need to keep an inventory that can tell you what different tools you have, how many of each you have on hand and the cost of each one. Write a program that lets you input the data concerning each tool, enables you to list all your tools, lets you delete a record for a tool that you no longer have and lets you update any information in the file. The tool identification number should be the record number. Use the following information to start your file.


RECORD#

TOOL NAME

QUANTITY

COST

3

Electric Sander

7

57.98

17

Hammer

76

11.99

24

Jig Saw

21

11.00

39

Lawn Mower

3

79.50

56

Power Saw

18

99.99

68

Screwdriver

106

6.99

77

Sledge Hammer

11

21.50

83

Wrench

34

7.50



Write a function to calculate and return the roots of a quadratic equation ax2 + bx + c = 0.



Return x1 and x2 through



parameter of the function. The prototype of this function is defined by:



void solveEquation(int a, int b, int c, float *x1, float *x2);




write a program that calculates and prints the sum of the even integers from 2 to user defined limit and product of odd integers from 1 to user defined limit. use a do-while loop that ask the user whether the program should be terminated or not also maintain a count as to how many times the user ran to do-while loop

write a program that calculates and prints the sum of the even integers from 2 to user defined limit and product of odd integers from 1 to user defined limit. use a do-while loop that ask the user whether the program should be terminated or not also maintain a count as to how many times the user ran to do-while loop

write a program that calculates and prints the sum of the even integers from 2 to user defined limit and product of odd integers from 1 to user defined limit. use a do-while loop that ask the user whether the program should be terminated or not also maintain a count as to how many times the user ran to do-while loop


  1. In the code editor, you are provided with a main() function that asks the user for two integers and calls the slowDisplay() function.
  2. This slowDisplay() function is a recursive function which should perform the functionality explained in the problem description above.
  3. This function is only partially implemented as it lacks a base case. Your task is to add the base case needed by this recursive function.

Example:

Starting num = 2

Next num = 3

It should then print 3 4 5


Given code:

#include <iostream>

using namespace std;


void slowDisplay(int, int);


int main(void) {

  int start, nextCount;


  cout << "Enter starting integer: ";

  cin >> start;


  cout << "Enter how many next integers: ";

  cin >> nextCount;


  slowDisplay(start + 1, nextCount);


  return 0;

}


void slowDisplay(int start, int nextCount) {

  // TODO: Add the base case here

  if(start == 0) {

    

    cout << start << " ";

    slowDisplay(start + 1, nextCount - 1);

  }

}



  1. In the code editor, you are provided with a main() function that asks the user for a string and passes this string and the size of this string to a function call of the function, preserveString().
  2. This preserveString() function has already been partially implemented. Your only task is to add the recursive case of this function.

To do: Print the string repeatedly, each time it prints the string, exclude the last letter until only 1 letter is left.


Given code:

#include <iostream>

#include <cstring>

using namespace std;


#define STR_MAX_SIZE 100


void preserveString(char*, int);


int main(void) {

  char str[STR_MAX_SIZE];


  cout << "Enter string: ";

  fgets(str, STR_MAX_SIZE, stdin);


  preserveString(str, strlen(str));


  return 0;

}


void preserveString(char *str, int size) {

  if(size > 0) {

    for(int i = 0; i < size - 1; i++) {

      cout << str[i];

    }

    cout << endl;


    // TODO: Add the recursive case of the function here

  }

}



LATEST TUTORIALS
APPROVED BY CLIENTS