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
docker41 [41]
3 years ago
14

Write a program trapezoid.cpp that prints an upside-down trapezoid of given width and height. However, if the input height is im

possibly large for the given width, then the program should report,
Computers and Technology
1 answer:
MatroZZZ [7]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

int main()

{    

   int rows, width, height, spaces, stars; // declare values

   cout << "enter width" << endl;

   cin >> width;

   cout << "enter height" << endl;

   cin >> height;

   for (int row = 0; row < height; ++row) {

       for (int col = height + row; col > 0; --col) {

           if (height % 6 == 1) {  

               cout << "Impossible shape!" << endl;

               return 0;

           }

           cout << " ";

       }

       for (int col = 0; col < (width - 2 * row); ++col) {

           cout << "*";

           spaces += 1;

           stars -= 2;

       }

       cout << endl;

You might be interested in
javascript Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
Luda [366]

Answer:

Explanation:

The following code is written in Javascript as requested and creates a function that takes in the total credit card debt amount and the minimum monthly payment. Then it calculates the new balance at the end of the year after paying 12 monthly minimum payments. Finally, printing out the new balance to the console which can be seen in the attached picture below.

let brainly = (debt, minimum) => {

   debt = debt - (minimum * 12);

   console.log("Credit Card Balance after one year: $" + debt);

}

brainly(50000, 3400);

7 0
4 years ago
When a program uses a ____, it reads all the records in the file from beginning to end, processing them one at a time. Group of
DIA [1.3K]

Answer:

nooo noob 2+2=5

Explanation:

why noob bullly bully

4 0
3 years ago
A(n) ____________________ can improve system performance when two devices have different data transfer rates, as when copying mu
defon

Hello there

the answer to the question is

<u><em>Buffer</em></u>

hope this helps

Best Regards Queen Z

8 0
3 years ago
Write a complete c++ program using function and array.​
lana66690 [7]

Answer:

Index Value Hash

0 1 $

1 2 $$

2 3 $$$

3 4 $$$$

4 5 $$$$$

Explanation:

8 0
3 years ago
Which of the following might be a job or task of an IT worker who manages networks?
Vladimir79 [104]
We need the options to be able to help.
7 0
4 years ago
Read 2 more answers
Other questions:
  • The order in which statements are executed during a program run. Answer 1 The first part of a compound statement begins with a k
    12·1 answer
  • On the UB-04 claim form, the type of bill is identified by a four-digit numerical code. The first digit is a leading zero, what
    10·1 answer
  • What is the ratio between total bits required for such a cache implementation over the data storage bits?
    10·1 answer
  • PLEASE FILL IN THE BLANK FOR THESE POINTS!!!!!
    15·2 answers
  • Brad is joining a big website design firm. He is worried that he may not be able to adapt to the company culture. What can he do
    15·1 answer
  • When computing the cost of the basket of goods and services purchased by a typical consumer, which of the following changes from
    11·1 answer
  • What private service may occur on a web server?
    7·1 answer
  • Let X and Y be two decision problems. Suppose we know that X reduces to Yin polynomial time. Which of the following statements a
    14·1 answer
  • Why it is not recommended to add sound effect on slide transition? Write at least two reasons.​
    6·1 answer
  • What is the collection of programs designed to operate control and manage the actual operation of the computer equipment​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!