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

Write a complete C++ program to write numbers 1 to 100 (vertically) in a data file NOTES.TXT


cin>> bilangan ;

for (int counter = 1; counter < bilangan ; counter ++)

   cout<< counter + 2 <<” ”<<endl;


What is the output if bilangan is 4 ?


Given the following C++ program segment, determine the final value of variable current.


  void calculate (int, int&);

int main() {

int current = 24, sum = 0; sum = current + 1;

   calculate(sum, current);

cout << current; return 0;

}

void calculate (int number, int& current) {

   current = current + number;

}



Create a class template for a class named Queue that holds

• A single data member as an array named list of size 10 to store certain elements

• A constructor to initialize queue with value 0 or 0.0 at all its indexes

• Three member functions i.e. sort() to sort the elements of the queue, max() that returns the maximum value present in the queue, min() that returns the smallest value present in the queue, and return_queue() that returns all the elements of the queue (in case of there being multiple maximum and minimum values present in the queue, the member functions should return notify the user of the number of times that value has been repeated in the queue and then return that value to the main function).

In the main() function, create three objects with different data types of class queue and test the functionality of member functions for various values of data members for these objects.


Write a main program to test the following functions:

void introduction() ;         // to display a text to tell what is the program about

bool keepRunning();           // to ask the user for more times to run the program

void ruuProgram();          // to input an array, calculate series (k=0 to n) a^2*[k]

Write two generic functions (overloaded) named area(). Create function template for the first area() function that it is able to receive the radius of a circle as its parameter and returns half of the calculated area of circle as of same data type. Similarly, create function template for the second area() function that it is able to receive two parameters as length and width of a rectangle and returns the triple of the calculated area of rectangle as of same data type. 


Write a generic function common() that calculates the double of each element in the array and returns the value which is most frequent in an array. The function arguments should be the address of the array and its size. Make this function into a template so it will work with an array of any data type i.e. int, long, double.


to write a C++ program which will read the given text file and will produce an

output text file with the name “Email_IDs” which must contain the valid email addresses of

the students mentioned in the input text file.


Bubble sort is an algorithm to sort a 1D array in ascending order. Firstly, explain bubble sort

and then write a C++ program by using the concept of templates to sort and display any type

of 1D array.


Write a C++ program to ask the user to enter the size and elements of an 1D array. Then ask

the user to enter an index and display the element at that index. If user enters a negative

index, then throw a string exception stating an invalid index and display the element at index

0. If the user enters an index greater than the maximum possible index, then throw an integer

exception and display the last possible index along with element at last index. If the user

enters a correct index, then simply display the element at that index.


LATEST TUTORIALS
APPROVED BY CLIENTS