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

Make a struct LINE include appropriate data members.

A line segment includes the endpoints, i.e. the points that it joins. 

structure should also provide a function to find the length of the Line 

Two lines can be compared to determine which line is shorter and vice versa. Provide function to compare two Lines 

Provide appropriate constructors for initialization.


Create a struct point to represent a point in cartesian coordinate system

provide member functions

default constructor

input

output

distance(returns the distance between two point objects, the function takes one object as an argument)

is zero(determines if a point is the center)

midlepoint (computes the middle point of an object from origin and returns the answer in a point object)

is equal to(compare two points)

isGreater than (compares two point in terms of the distance from the center)


A passenger train travels at a speed of 72 km/h. A man on the passenger train observes a
goods train travelling at a speed of 54 km/h in the opposite direction. If the good train passes him in X
seconds, write a C++ function to find the length of the goods train
Declare the class E-Bill consisting of data members cust_no, name, st_reading, end_reading, tot_usage and amount to find total energy usage and amount per unit of electric energy. The parameterized constructor are used to initialize object of class E-Bill, then find the total energy usage and amount per unit of electric energy and display the information of E-Bill electric energy. Finally free the resources of data objects using destructor member function. (Note: Amount per unit is Rs. 5.50)

Previous lesson displays static information. In this lesson we are going to use the dynamic display of information. #include <iostream> using namespace std; int main(){ //we declare data types here. string name; //fist we need to display the Instruction for the user."Enter your name: cout<<"Enter your name: //we call the "name" variable to get the user input. we use "cin" to get the user input cin>>name; //we call again our variable name to display what the user input. cout<<"Your name is: "<<name; //try it and try to complete the personal information. add the following variables //age, gender, address, email, mobile }


Hello!

I am trying to find how many jelly beans can fit in a jar. so I made some variables.


 double height, diameter, beanLength, beanDiameter, glassThickness, radius, newRadius;

  double volumeOfJar, airCubicInches, trueVolume, jellyBeanVolume;


as show here. But I need to initialize them. so I tried this


 int height;

  int diameter;

  int beanLength; beanLength = 0.625;

  int beanDiameter; beanDiameter = 0.25;

  int glassThickness;

  int radius;

  int newRadius;

  int volumeOfJar;

  int airCubicInches;

  int trueVolume;

  int jellyBeanVolume;


But my program does not like that. How do I fix the varibles to be initialized?



diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,

find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole

number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.


The diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,

find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole

number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.


Creat a class named Rectangle with integer instance variables named width, height, area and perimeter. Override the default constructor and use it to set these variables to zero. Also include another constructor that accepts perimeters for the width and height instance variables and initializes the instance variables area and perimeter to zero.
Include the following accessor and mutator methods;
I) setWidth which accepts a parameter that can be used to assign the width instance variable.
2) setHeight which accepts a parameter that can be used to assign the height instance variable.
3) getArea that returns the value of area instance variable.
4) getPerimeter that returns the value of perimeter instance variable.

Also include following custom methods:
1) computeArea which computes a rectangle's area but doesn't return a value
2) computePerimeter Which computes a rectangle's perimeter and also doesn't return a value.

Assume a file named 

Random.txt

exists, and contains a list of random numbers. Write a program that opens the file, reads all the numbers from the file, and calculates the following:

  • The number of numbers in the file
  • The sum of all the numbers in the file (a running total)
  • The average of all the numbers in the file


The program should display the number of numbers found in the file, the sum of the numbers, and the average of the numbers.

Output Labels:

Print each of the above quantities on a line by itself, preceded by the following (respective) strings: "

Number of numbers: 

", "

Sum of the numbers: 

", and "

Average of the numbers: 

".

Sample Run

Number of numbers: 20

Sum of the numbers: 210

Average of the numbers: 10.5 


LATEST TUTORIALS
APPROVED BY CLIENTS