1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MissTica
3 years ago
8

This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by

user specified arrow base height, arrow base width, and arrow head width.
(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight.
(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base.
(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head.
(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width.
while (arrowHeadWidth <= arrowBaseWidth) { // Prompt user for a valid arrow head value }
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow base height: 5 Enter arrow base width: 2 Enter arrow head width: 4
**
**
**
**
**
****
***
**
*
#include
int main(void) {
int arrowBaseHeight;
int arrowBaseWidth;
int arrowHeadWidth;
printf("Enter arrow base height:\n");
scanf("%d", &arrowBaseHeight);
printf("Enter arrow base width:\n");
scanf("%d", &arrowBaseWidth);
printf("Enter arrow head width:\n");
scanf("%d", &arrowHeadWidth);
printf("\n");
// Draw arrow base (height = 3, width = 2)
printf( "**\n");
printf( "**\n");
printf( "**\n");
// Draw arrow head (width = 4)
printf( "****\n");
printf( "***\n");
printf( "**\n");
printf( "*\n");
return 0;
}

Computers and Technology
1 answer:
andreyandreev [35.5K]3 years ago
6 0

Answer:

Follows are the modified code to this question:

#include <stdio.h>//defining a herader file

int main(void) //defining a main method

{

  int arrowBaseHeight = 0,arrowBaseWidth = 0,arrowHeadWidth = 0 ;//defining integer variable

  int i, j; //defining integer variable

  printf("Enter arrow base height:");//print message  

  scanf("%d", &arrowBaseHeight);//input value in arrowBaseHeight variable

  printf("Enter arrow base width:");//print message

  scanf("%d", &arrowBaseWidth);//input value  in arrowBaseWidth variable

  while (arrowHeadWidth <= arrowBaseWidth)//defining while loop to check arrowHeadWidth less then equal to arrowBaseWidth  

  {

      printf("Enter arrow head width:");//print message

      scanf("%d", &arrowHeadWidth);//input value in arrowHeadWidth variable

      printf("\n");//use for line spacing

  }

  // defining for loop for print vertical line of asterisk

  for (i = 0; i < arrowBaseHeight; i++)//defining for loop for print row  

  {

      for (j = 0; j < arrowBaseWidth; j++) //defining for loop for print column

      {

          printf("*");//print asterisk value

      }

      printf("\n");//use for line spacing

  }

//defining for loop for print reverse triangle

  for (i = arrowHeadWidth; i > 0; i--) //defining loop for input length  

  {

      for (j = i; j > 0; j--) //defining loop for triangle  

      {

          printf("*"); //print asterisk value

      }

      printf("\n");//use for line spacing

  }

  return 0;

}

Output:

please find attach file.

Explanation:

In the code, inside the method five integer variable "arrowBaseHeight, arrowBaseWidth, arrowHeadWidth, i, and j" is defined, in which the first three variables are used for input value from the user end, and "i and j" are used in the loop.

In the next step while loop is used for input the value, but in this code, mainly two for loop is used which can be defined as follows:

  • In the first loop, it is used the "arrowBaseHeight and arrowBaseWidth" variable to print the vertical line of the asterisk.
  • In the second loop, it uses the "arrowHeadWidth" variable to print the reverse triangle.

You might be interested in
Software that enables you to display and interact with text and other media on the web is a web ________.
a_sh-v [17]
It's a web site or web page
5 0
4 years ago
________an approach to database and software development that emphasizes "individuals and interactions over processes and tools,
dimulka [17.4K]

Answer:

Agile software development

Explanation:

Agile software development  model is a blend of iterative and steady procedure models with center around process flexibility and consumer loyalty by fast conveyance of working programming item. Nimble Methods break the item into little gradual forms. These assembles are given in emphases.

So in blank space there will be Agile software development

7 0
3 years ago
How to check iready minutes when i cannot log into iready
Alekssandra [29.7K]

Answer:

If you are the host of the iready like a teacher then you should be able to see how much time you have left. If not you should probably ask them.

Explanation:

3 0
3 years ago
When the POST is complete,t he operating systems is loaded into?
Lina20 [59]
<span>After the POST is successfully completed the CPU searches Storage devices for special files that indicate the beginning of the OS and then loads it into memory. </span>

<span><span>The sequence in which the storage devices are searched is part of the configuration set-up stored in BIOS. 

</span><span>Once the Operating System (OS) is located, the CPU copies what’s called the 'boot record' from the OS into DRAM. 

</span><span>Control is then passed to the 'boot record' in DRAM, which then continues loading the rest of the OS. 

</span><span>This process continues until the OS load is completed. 

</span><span>When the OS load is completed the Desktop appears in the display and waits for you, the user, to tell it what you want it to do.</span></span>
4 0
3 years ago
Identify the tools on the boxes. write the answer
Gnom [1K]

Answer:

im going off of what i know =( 2 screw driver 3 zip ties 5 needle nose plyers 8 can air

Explanation:

5 0
3 years ago
Other questions:
  • Which of the following modes of replication requires a very low latency network connection and ensures data remains in synch wit
    5·1 answer
  • A drowsy cat spots a flowerpot that sails first up and then down past an open window. The pot is in view for a total of 0.50 sec
    13·1 answer
  • Kash has created a document that needs to be protected. only certain users should be able to open the document. what option shou
    5·1 answer
  • Write a MASM program to calculate Fibonacci numbers:
    10·1 answer
  • 1. ___________ ensures the integrity and security of data that are passing over a network.
    13·1 answer
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • write a program in C# that reads a set of integers and then finds and prints the sum of the even and odd integers?​
    12·1 answer
  • Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
    7·1 answer
  • When you use the Query Editor to run a query that returns an xml type, theManagement Studio displays the XML data in blue with u
    13·1 answer
  • Choose all of the items that represent parts of an operating system.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!