Create a structure called employee that contains two members: an employee
number (type int) and the employee’s compensation (in dollars; type float). Ask the
user to fill in this data for three employees, store it in three variables of type struct
employee, and then display the information for each employee.
Given three sides of the triangle(a, b, c) as input. Write a program to determine whether the triangle is Equilateral, Isosceles or Scalene.Input
The first line of input will contain an integer A.
The second line of input will contain an integer B.
The third line of input will contain an integer C.Output
If the given sides A, B and C are equal, print "Equilateral".
In the given sides any of two sides are equal print "Isosceles".
If the given sides A, B, C are not equal to each other, print "Scalene".Explanation
For example, if the given sides are 4, 4, 4 the output should be "Equilateral".
Similarly, if the given sides are 3, 2, 3 the output should be "Isosceles".
The following program prints a picture of a large letter I. The output has 13 rows and 7 columns. The first row and last two rows make horizontal lines at the top and bottom of the letter. The other 10 rows form a vertical line in the letter. The program output should look as follows:
-------
|
|
|
|
|
|
|
|
|
|
-------
-------
Some pieces of the code have been replaced by PART (a), PART (b), and so on. To answer the 6 parts of this question you should supply the part of the line of C++ code that was replaced. Each answer must fit on a single line.
int main()
{
int rows = 13;
int cols = 7;
for (int c = 1; {\bf PART (a)} ){
cout << "-"; }
cout << endl;
for (int r = 1; {\bf PART (b)} ){
for (int c = 1; {\bf PART (c)} ){
cout << " "; }
cout << {\bf PART (d)}; }
for ({\bf PART(e) }){
for ({\bf PART (f) }){
cout << "-"; }
cout << endl; }
return 0; }
Insert the missing condition in the following code fragment. The code is intended to compute the product of several integers entered by the user. The loop should stop when the user enters something other than an integer.
int product = 1;
int value;
cin >> value; while (______ )
{
product = product * value;
cin >> value;
}
Consider a flow chart for computing travel time between Wall Street in Manhattan and St. John’s University. Write a code fragment that represents this flow chart. Assume that there are variables called route and rush hour of type string.
write a C++ statement that assigns a 4 digit random number between 1000 and 10000 as the value of the variable n
Consider a flow chart for computing travel time between Wall Street in Manhattan and St. John’s University. Write a code fragment that represents this flow chart. Assume that there are variables called route and rush hour of type string.
Given the variable n of type int and the variable s is of type string, translate the following conditions to C++.
1. n is at least 10.
2. s begins and ends with the same letter.