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

Which attribute is used to define the font type

Which of the following apply to the while loop only? To the do...while loop only? To both?

a. It is considered a conditional loop.

b. The body of the loop executes at least once.

c. The logical expression controlling the loop is evaluated before the loop is

entered.

d. The body of the loop may not execute at all.


Suppose that x, y, and z are int variables, and x = 10, y = 15, and z = 20. Determine whether the following expressions evaluate to true or false:

a. !(x > 10)

b. x <= 5 || y < 15

c. (x != 5) && (y != z)

d. x >= z || (x + y >= z)

e. (x <= y - 2) && (y >= z) || (z - 2 != 20)


Suppose that x, y, and z are int variables, and x = 10, y = 15, and z = 20. Determine whether the following expressions evaluate to true or false:

a. !(x > 10)

b. x <= 5 || y < 15

c. (x != 5) && (y != z)

d. x >= z || (x + y >= z)

e. (x <= y - 2) && (y >= z) || (z - 2 != 20)


Which of the following apply to the while loop only? To the do...while loop only? To both?


a. It is considered a conditional loop.


b. The body of the loop executes at least once.


c. The logical expression controlling the loop is evaluated before the loop is


entered.


d. The body of the loop may not execute at all.

In main take two numbers as input num1 and num2. Main thread will create 2 more threads.

1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)

2. T2: Take a string as input and count num1 and num2 in it.


Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a mainthat prompts a user for a list of 15 integers and outputs the index and value of the first occurrence of the smallest value. 

An example of the program is shown below: 

Enter 15 integers: 
1
2
3
4
5
6
7
8
9
0
10
11
12
13
14
1 2 3 4 5 6 7 8 9 0 10 11 12 13 14 
The position of the first occurrence of the smallest element in list is: 9
The smallest element in list is: 0

You can use the following integer lists to test your code: 

  • 56, 34, 67, 54, 56, 87, 66, 92, 15, 32, 55, 54, 88, 92, 30
  • 79, 26, 97, 87, 73, 44, 67, 46, 55, 13, 20, 20, 33, 42, 60
  • 63, 1, 40, 81, 30, 11, 26, 44, 98, 1, 80, 98, 15, 3, 42





main take two numbers as input num1 and num2. Main thread will create 2 more threads.


1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)


2. T2: Take a string as input and count num1 and num2 in it.

For this assignment Write a program in ‘C++’, that uses a Nested Structure to accept the name

of five Players of Chess:

Numbers of games played

Date of Birth

Date of playing first international game

Age

Status either win or loss

Use structures for Date of Birth and International Game in the main structure Chess.

struct chess

{

-------

-------

struct dob

{

------

------

};

struct igame

{

------

------

};

};

When the program runs, it should ask the user to enter data for five Players of Chess.


Paula and Danny want to plant evergreen trees along the back side of their yard. They do not want to have an excessive number of trees.

Write a program that prompts the user to input the following:

  1. The length of the yard.
  2. The radius of a fully grown tree. (Use 3.14159 as the constant value for any calculations that may need \pi
  3. π).
  4. The required space between fully grown trees.

The program outputs:

  1. The number of trees that can be planted in the yard
  2. The total space that will be occupied by the fully grown trees.

Format your output with setprecision(2) to ensure the proper number of decimals for testing!



LATEST TUTORIALS
APPROVED BY CLIENTS