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

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!



write c++ programm to swap first and last element of an integer 1-D array


Write a program that uses for loops to perform the following steps:

  1. Prompt the user to input two integers: firstNum and secondNum
  • (firstNum must be less than secondNum).
  1. Output all odd numbers between firstNum and secondNum.
  2. Output the sum of all even numbers between firstNum and secondNum.
  3. Output the numbers and their squares between 1 and 10.
  • Separate the numbers using any amount of spaces.
  1. Output the sum of the square of the odd numbers between firstNum and secondNum.
  2. Output all uppercase letters.

Write a program that uses do...while loops to perform the following steps:

  1. Prompt the user to input two integers: firstNum and secondNum
  • (firstNum must be less than secondNum).
  1. Output all odd numbers between firstNum and secondNum.
  2. Output the sum of all even numbers between firstNum and secondNum.
  3. Output the numbers and their squares between 1 and 10.
  • Separate the numbers by any amount of spaces.
  1. Output the sum of the square of the odd numbers between firstNum and secondNum.
  2. Output all uppercase letters.

The population of town A is less than the population of town B. However, the population of town A is growing faster than the population of town B.

Write a program that prompts the user to enter:

  1. The population of town A
  2. The population of town B
  3. The growth rate of town A
  4. The growth rate of town B

The program outputs:

  1. After how many years the population of town A will be greater than or equal to the population of town B
  2. The populations of both the towns at that time.

(A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)


The population of town A is less than the population of town B. However, the population of town A is growing faster than the population of town B.

Write a program that prompts the user to enter:

  1. The population of town A
  2. The population of town B
  3. The growth rate of town A
  4. The growth rate of town B

The program outputs:

  1. After how many years the population of town A will be greater than or equal to the population of town B
  2. The populations of both the towns at that time.

(A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)


LATEST TUTORIALS
APPROVED BY CLIENTS