SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 2 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 20 Nov 2017 My Price 10.00

till need to be correct after any code changes.

Can you help me with this code? I have 5 different outputs listed below. I only need number 5 to be corrected but output 1 - 4 still need to be correct after any code changes.

 

Here is my code:

 

#include <iostream>

 

using namespace std;

 

int main() {

int arrowBaseHeight = 0;

int arrowBaseWidth = 0;

int arrowHeadWidth = 0;

int i, j;

 

cout << "Enter arrow base height: " << endl;

cin >> arrowBaseHeight;

 

cout << "Enter arrow base width: " << endl;

cin >> arrowBaseWidth;

 

cout << "Enter arrow head width: " << endl;

cin >> arrowHeadWidth;

 

 

// Draw arrow base

while(arrowBaseHeight--)

 

{ for(i=arrowBaseWidth; i>0; i--)

 

{ cout << "*";}

 

cout << endl;}

 

// Draw arrow head

 

while(arrowHeadWidth)

 

{

 

for(i=arrowHeadWidth; i>0; i--)

 

cout<< "*";

 

cout << endl;

 

arrowHeadWidth--;

 

}

return 0;

}

 

1. Compare output - Correct

Input

5

2

4

 

Your output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

**

**

**

**

**

****

***

**

*

 

2. Compare output - Correct

Input

2

3

4

Your output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

***

***

****

***

**

*

 

3. Compare output - Correct

Input

3

3

7

Your output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

***

***

***

*******

******

*****

****

***

**

*

 

4. Compare output - Correct

Input

5

1

3

Your output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

*

*

*

*

*

***

**

*

 

5. Compare output

 

Input

2

4

3

4

8

 

Your output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

****

****

***

**

*

 

Expected output

Enter arrow base height: 

Enter arrow base width: 

Enter arrow head width: 

Enter arrow head width: 

Enter arrow head width: 

****

****

********

*******

******

*****

****

***

**

*

 

Capture5.PNG

Attachments:

Answers

(5)
Status NEW Posted 20 Nov 2017 08:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)