Coding 3 basic programs in c++, writing homework help

Coding 3 basic programs in c++, writing homework help

Program 1:

The following program generates displays all two-letter .com internet domain names, 13 names

per line.

#include <iostream>

using namespace std;

int main( )

{

char letter1, letter2;

int count=0;

cout<<“**** two-letter domain names ****” <<endl;

cout<<“********************************” << endl;

for (letter1=’a’; letter1 <=’z’; letter1++)

{

for (letter2=’a’; letter2 <=’z’; letter2++)

{

cout<< letter1<<letter2<<“.comt”;

count++;

if(count % 13 == 0)

cout <<endl;

}

cout << endl;

}

}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Student must do this in the program:

1. Type in the above program, add your name and date, compile and run the program

2. How many times does the outer loop execute?

3. How many times does the inner loops execute?

4. Modify the program to include two-character .com names where the second character can be

a letter or a number, as in a2.com.

Submit a copy of the final program (5 points) and answers to questions 2 & 3 (5 points).

You don’t need to submit an output for this program.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Program 2:

Write a program that graphically depicts an integer’s magnitude by using asterisk, creating a

histogram. Hint: The inner loop handles the printing of the asterisk and the outer loop handles

exciting until zero is entered. Make sure you don’t accept negative numbers.

Sample run:

Enter a positive integer (0 to quit): 5

*****

Enter a positive integer (0 to quit): 8

********

Enter a positive integer (0 to quit): -5

Enter a positive integer (0 to quit): -10

Enter a positive integer (0 to quit): 15

***************

Enter a positive integer (0 to quit): 0

Good Bye!

++++++++++++++++

Student must do this in the program:

Submit a copy of the program (15 points) and sample output for at least 4-5 numbers, including

invalid data (5 points).

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Program 3:

Write a program to display an upside down right triangle. Yu should ask the user to provide you

with the height.

Sample Run:

Enter a number between 5 and 50: 10

**********

*********

********

*******

******

*****

****

***

**

*

Would you like to continue (Y/N)? N

Good bye!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Student must do this in the program:

Submit a copy of the program (15 points) and sample output for at least 2-3 numbers, including

invalid data (5 points).

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper