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
Leto [7]
3 years ago
11

Prompt the user for a character and the height of a right triangle. Then, print a triangle of that height using the character en

tered. Validate that the height entered is > 0. If not, ask the user repeatedly until they comply. Hint: Use nested loops Example Input Corresponding output Enter a character: # #Enter a height: 4 ## ###

Computers and Technology
1 answer:
valina [46]3 years ago
8 0

Answer:

Complete code with comments for explanation and output results are given below

Explanation:

#include <iostream>

using namespace std;

int main()

{

   int h;

   char ch;

// prompt the user for a character

   cout << "Enter the character"<<endl;

   cin >> ch;

// prompt the user for the height of the triangle

   cout << "Enter the height of the triangle"<<endl;

   cin >> h;

   // validate the input by checking if it is less or equal to 0

   if (h <= 0)

   {

       cout<<"wrong selection! Enter height again"<<endl;

       cin>>h;

   }

// run two nested loops one for rows and one for columns to print the triangle

   for(int i = 1; i <= h; i++)

   {

       for(int j = 1; j <= i; j++)

       {

           cout <<ch;

       }

       cout << "\n";

   }

   return 0;

}

Output:

Enter the character

%

Enter the height of the triangle

0

wrong selection! Enter height again

9

%

%%

%%%

%%%%

%%%%%

%%%%%%

%%%%%%%

%%%%%%%%

%%%%%%%%%

You might be interested in
Let’s say you are given a number, a, and you want to find its square root. One way to do that is to start with a very rough gues
o-na [289]

Answer:

Check the explanation

Explanation:

package com.squarerrot;

public class SquareRoot {

/**

*

*/

public static double squareRoot(double input) {

System.out.println("Trace for input:" + input);

//random value initialized to 6 here

double output, guessValue = 6, previousValue = 0;

while (input - (output = approximateValue(input, guessValue)) >= 0.00005

&& previousValue != output) {

guessValue = output;

previousValue = output;

System.out.println(output);

}

return output;

}// end of method squareRoot

// calculate the approximate value

public static double approximateValue(double input, double start) {

return (start + (input / start)) / 2;

}// end of method approximateValue

// test the square root method

public static void main(String[] args) {

System.out.println("Square Root of 9:" + squareRoot(9));

System.out.println("Square Root of 16:" + squareRoot(16));

}// end of method main

}// end of the class

7 0
3 years ago
Using tracking code, Google Analytics can report on data from which systems? A. E-commerce platforms.B. Mobile Applications.C. O
Allushta [10]

Answer:

E-commerce platforms

Mobile Applications

Online point-of-sales systems

Explanation:

Google Analytics provide users with a deeper understanding of their customers. It provides them with the free tools needed for analyzing data for your business. Google Analytics uses tracking code to report data on some systems. Some systems that Google Analytics use tracking code for are: E-commerce platforms , Mobile Applications , and Online point-of-sales systems.

3 0
4 years ago
RTOS stands for ______ Time Operating System.
ch4aika [34]

Answer:

Real Time Operation System

Explanation:

6 0
3 years ago
Suppose that you have been asked to create an information system for a manufacturing plant that produces nuts and bolts of many
maksim [4K]

Answer:

Following are the solution to this question:

Explanation:

In essence, both issues (relevant) were addressed, that form the design of the system, and all of the information collected and during initial analysis along with all subsequent stages will, in turn, affect the design of the system. Being aware, that perhaps the data is obtained to establish the entities, attributes, or relations. In particular, partnerships, clearly outline, or cardinal-ties are shaped by company policies derived from the creator's information. Example problems and the probable effects on the layout may be:

It will create the file concurrently for all depts, or would like to build and execute the database simultaneously with one dept?  

How would the work be to design affect the development process? In other terms, determine the range of the system as well  

as its limits about the bottom-up, centralized, or decentralized.

Do you want, and would you like an integrated framework to develop a single module? (Inventory, production, shipping, billing, etc.)  

Would you like a product code, output change, and form of controlling the bolts and bolts and dept? Impact: design of the logical and physical server.  

Perhaps you'd like to monitor the sources of every lot a raw resources for the nuts and bolts manufacturing? Impact: design of the logical and physical server. Model E-R.  

Perhaps you'd like to monitor consumers receiving shipments of bolts and nuts? Impact: design of the logical and physical database. ER model.  

Its documents will you demand, or to whom can these documents be transmitted? What specific reporting requirements?  

Reactions to such concerns relate to the design, execution, testing, or subsequent functioning of the logical and physical system.

8 0
3 years ago
The database management system is a program used to create, process, and administer a database.
omeli [17]
The Answer is True.
7 0
3 years ago
Other questions:
  • PYTHON CODE ONLY:
    7·1 answer
  • _____, which are generated by web server software, record a user's actions on a web site. viruses log files junk e-mails worms
    7·1 answer
  • How to find something in the cloud?
    8·1 answer
  • A type of specialty processor devoted exclusively to protecting your privacy.
    9·2 answers
  • Which is not the option applicable to the technology reference framework for advanced countries?
    11·1 answer
  • PLEASE HELP
    6·1 answer
  • An operating environment for a computer is ____, free of potential contaminants, and with the temperature and humidity range spe
    9·1 answer
  • Consider the following code segment. The code is intended to read nonnegative numbers and compute their product until a negative
    11·1 answer
  • In MMF2, what does the * symbol mean?
    5·1 answer
  • Can someone please help? i am trying to code my raspberry pi pico in python, and it says this is wrong. Can someone help tell me
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!