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

Explain the difference between class to basic type conversion and basic to class type conversion

Use basic to class type conversion to covert a long integer value to class datatype



Enter a 4 digit number and display the value at thousands position,hundreds position, tens position and ones position.

Write a program to create a class students having name, id, age. Create a file student.txt and open in append mode. Write the detail of 3 students into a file and read the data from the file and display on screen. Also copy content of this file into another file

1 an array containing 5 integer elements is already provided for you in the code editor below



2 print out the cube of the 1st, 3rd and 5th element of the given array

Declare a two-dimensional array with the dimensions needed to store the data for a baseball game. It must store the data of the runs, hits and errors as well as the runs made in each inning (inning) by each team up to 9 innings. The team with the highest score wins.


You must read the data values for each team and then print the data as it appears on the stadium scoreboard, taking into account each possible play that occurs in an inning. If there is a tie they go to extraining and the homeclub in the lower part will win if the visitor is below, but if the visitor exceeds the score in this situation then the visitor wins. The extrainnig will be made up to 13 innings, and if there is still a tie, make the program end with an error message indicating that the relievers are over and therefore the game is also over, which will be decided the next day with whoever scores the first run .


Write a C++ program to calculate area and perimeter of square and rectangle using function.

Output Example should be

Enter Side of a square: 4

Enter Length and Breadth of Rectangle: 3 6


The Area of a square is: 16

The Area of Rectangle is: 18

The Perimeter of a Square is: 16

The Perimeter of a rectangle is 18


  1. Input five decimal numbers in one line.
  2. Print out the decimal numbers in one line, separated by spaces, and make sure you only print up to 1 decimal place.
  3. Add the first four decimal numbers and check if their sum is greater than the fifth decimal number. Print out "Yes" if they are.

An alternative implementation of singly linked list is to create a structure of two external

pointers for the list, which contains both head and tail pointers.(( )* )

1

i ThoughtNumber MaximumNumber ThoughtNumber ThoughtNumber

n

i


100  *100

struct list {

nodeptr head;

nodeptr tail;

};

These pointers points to the first and the last elements of the list. Thus, the cost of

inserting a new element at end and deleting from the end of the list will be optimized to

O(1). Therefore, considering the given specification, write a C++ program which

implements the necessary operations for both unsorted and sorted list.

I. For unsorted list

 Insertion of new element at head and at end

 Deletion of an element from head, end and any element which mentioned with

key

 Print

 Search

II. For sorted list

 Insertion of new element at its proper position

 Deletion of an element from head, end and any element which mentioned with

key

Print

Search




// Lab: Binary Search (find errors)

// Written by:

#include <iostream>

#include <cstdlib>


using namespace std;


int binarySearch(const int array[], int numElems, int value);


int main() {

  int list[100] = {5, 5, 8, 8, 8, 8, 9, 8, 9, 9, 10};

  int length = 11;

   

  for (int i = 0; i < length; i++) {

    cout << list[i] << " ";

  }

  cout << endl;

   

  for (int i = 0; i < 2 * length; i++) { // SEARCH 2 * length times

   

    int target = rand() % 5 + 5; // generate a random target within the range 5 to 10

    int location = binarySearch(list, length, target);


    if (location = - 1)

      cout << target << " NOT found!" << endl;

    else

    {

      // print a range: from index A to Z, inclusive!

      int z = location + 1;

      while( z < length && list[z] == list[location] )

        z++;

      z--;

       

      

   


: Write a program to take input for n book records from user and write those book records in a file named: ”record”, whose price is less than INR 500 . Program should also perform random access in the file, after taking input for a particular record number to read and it should also perform random record overwriting after taking input of new record and the record number to overwrite. After overwriting record, display all records on the screen [Attributes of book: Book_id, Book_price, Book_name, Book_author_name]


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS