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
PLEASE HELP!
Basile [38]

Answer:

declare count as integer

7 0
3 years ago
Each array in Java has a public field named ________ that contains the number of elements in the array.
Helen [10]

Answer:

length.

Explanation:

length variable determines the size of the array or the number of elements in the array.length variable is a final variable.It is a public field.It is only applicable for array it is not applicable for strings.It is also used to directly access the field member of the array.So we conclude that the answer is length.

7 0
4 years ago
If a laptop is getting no power while plugged in, which hardware part often needs to be replaced?
Eva8 [605]

Answer:

power supply is most likely faulty

3 0
3 years ago
What does network administration normally include? Check all of the boxes that apply.
Paul [167]

Answer: design of the network

security for the network

documentation

identifying and fixing issues

Explanation: I just took the test

8 0
4 years ago
Learning how to use word processing and spreadsheets, and creating presentations are all considered __________ computer skills.
irina [24]

Answer: a i hope it help

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • To adjust the margins on a page, users will navigate to the _____ tab.
    13·2 answers
  • Which of the following is an example of batch processing?
    14·1 answer
  • Angle parking spaces are generally entered at an angle about __________ from the curb.
    8·2 answers
  • Convert the following denary numbers into binary using 8-bit register:
    6·1 answer
  • Jared has trouble remembering when his assignments are due, and he wants to keep reminders on his computer. Which online note-ta
    10·2 answers
  • Which Boolean operator enables you to exclude a search term?
    11·1 answer
  • Is a free verse a poetry that has no images
    5·2 answers
  • What would be the greatest tool for emphasis? (video class)
    9·1 answer
  • What is the final step when creating an appointment to ensure that the content of the appointment is stored in Outlook?
    13·1 answer
  • which of these devices has 3000-A fuses that provide fault protection for the 4000-a, 480/277-V, 3-phase bus that feeds seven ci
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!