answer.
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]
1 year 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]1 year 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
1. What should you do if your computer is shared by your entire family and you install a plugin that saves user names and passwo
Citrus2011 [14]

Explanation:

1 make sure only you know the password

2 having weak security on one browser is basically a doorway for someone to get into your network

7 0
2 years ago
Read 2 more answers
Which of the following statements is true? A. Interpreted programs run faster than compiled programs. B. Compilers translate hig
alina1380 [7]

Answer:

B.

Explanation:

Computer programs are written in high level languages. Every language has its own set of syntax and semantics.

Computer only understands instructions in machine language which is written using strings of 0 and 1.

Thus, for execution of a high level language program, it is mandatory to convert high level instructions into machine instructions.

This translation into machine language is done in two ways – compilation or interpretation.

Some languages are compiled while others are interpreted.

Both compilers and interpreters are programs and process the high level language program as needed.

Compiler

Any program written in high level language is compiled.

The program is first analyzed before compilation. This process takes time. The analysis phase is called pre processing.

The program compilation stops only when the program is completely analyzed. Hence, it is difficult to locate the error in the program. This makes debugging easy.

Debugging is defined as removal of errors in the programs.

A compiler is responsible for converting high level language code into machine level code.

The complete program undergoes compilation at the same time.

A compiled program executes faster than an interpreted program.

A compiled program produce machine code which is a collection of 0 and 1, hence, it takes less time to execute.

Examples of compiled languages are C and C++.

Interpreter

Some high level languages are interpreted.

The high level language code is translated into an intermediate level code. This intermediate code is then executed.

The analysis of the program takes less time and takes place before interpretation begins. The analysis phase is called pre processing.

An interpreted program is translated one line at a time.

The program interpretation stops when an error is encountered. This makes debugging easy.

Debugging is defined as removal of errors in the programs.

Examples of interpreted languages include Python and Ruby.

6 0
2 years ago
Read 2 more answers
As the network administrator for a growing isp, you want to make efficient use of your network addresses. one of the network add
lubasha [3.4K]

New Subnet Mask:

255.255.255.240

First 4 subnetwork Addresses:

197.14.88.0

197.14.88.16

197.14.88.32

197.14.88.48

6 0
2 years ago
5. Assume a computer has a physical memory organized into 64-bit words. Give the word address and offset within the word for eac
spin [16.1K]

Answer:

see explaination and attachment

Explanation:

5.

To convert any byte address, By, to word address, Wo, first divide By by No, the no. of bytes/word, and ignores the remainder. To calculate a byte offset, O, in word, calculate the remainder of By divided by No.

i) 0 : word address = 0/8 = 0 and offset, O = 0 mod 8 = 0

ii) 9 : word address = 9/8 = 1 and offset, O = 9 mod 8 = 1

iii) 27 : word address = 27/8 = 3 and offset, O = 27 mod 8 = 3

iv) 31 : word address = 31/8 = 3 and offset, O = 31 mod 8 = 7

v) 120 : word address = 120/8 = 15 and offset, O = 120 mod 8 = 0

vi) 256 :word address = 256/8 = 32 and offset, O = 256 mod 8 = 0

6. see attachment for the python programming screen shot and output

4 0
2 years ago
_____ is a markup language designed to transport and store data on the Web. Group of answer choices Standard Generalized Markup
Kisachek [45]

<u>Extensible Markup Language (XML)</u> is a markup language designed to transport and store data on the Web.

Explanation:

  • Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable
  • Extensible means that the language is a shell, or skeleton that can be extended by anyone who wants to create additional ways to use XML.
  • Markup means that XML's primary task is to give definition to text and symbols.
  • It is a textual data format with strong support, Unicode for different human languages.
  • Extensible Markup Language (XML) is used to describe data.
  • The design goals of XML emphasize simplicity, generality, and usability across the Internet.
  • It is a text-based markup language derived from Standard Generalized Markup Language (SGML).
4 0
1 year ago
Other questions:
  • How did josh norman and mike keller provide coverage of katrina?
    9·2 answers
  • A student made a model of isostasy by placing a block of wood in a beaker of water. What does the wooden block represent in the
    14·2 answers
  • there are four stage of the product life cycle. during which of these stages do you think is the best time for a company to purc
    10·2 answers
  • Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
    15·1 answer
  • As you are planning your informative speech on the prevalence of Internet memes in pop culture and you wonder if your audience w
    14·1 answer
  • In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all
    7·1 answer
  • Gwen recently purchased a new video card, and after she installed it, she realized she did not have the correct connections and
    6·1 answer
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • Can you find the reason that the following pseudocode function does not return the value indicated in the comments? // The calcD
    6·1 answer
  • The Tell Me feature also includes access to the _____ feature.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!