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
ddd [48]
3 years ago
8

Given an int variable n that has already been declared and initialized to a positive value , and another int variable j that has

already been declared , use a while loop to print a single line consisting of n asterisks. thus if n contains 5, five asterisks will be printed. use no variables other than n and j.
Computers and Technology
1 answer:
Ugo [173]3 years ago
8 0
While( n )  /*when n == 0, will fail*/
{
   putchar( '*' );  /*effectively print asterick*/
   n--;    /*post-decrement n*/
}
You might be interested in
Give one example of a civil engineering structure.
mafiozo [28]

Answer:

Airports, roads, bridges, dams, sewerage, railways, and many more.

Explanation:

Civil engineering concerns constructing, designing, and maintaining a physical environment. Examples of civil engineering are airports, roads, bridges, dams, sewerage, railways, etc.

5 0
3 years ago
Why was the movable type of the printing press such a breakthrough for publishing?
guapka [62]
Movable type is not part of a printing press. Before movable type and printing presses, things had to be manually transcribed (copied by hand), which was  extremely expensive. The press mechanized copying, lowering it's cost and driving down the cost of reproduction.

Arguably, there wasn't any publishing before movable type and printing presses.
3 0
3 years ago
Read 2 more answers
You will include code that will validate all user input. If the user inputs an invalid value, the program will respond with an e
alukav5142 [94]

Answer:

See explanation (Program written in C++)

Explanation:

The question is incomplete as the invalid values were not included in the question.

However, to make the sense of it, I'll answer your question using the following conditions.

1. Invalid values include: Numbers less than 0 (See comments for explanations)

#include <iostream>

using namespace std;

int main() {

//This line declares num (for user input)

int num;

//The following iteration keeps repeating itself until a number greater than 0 is entered using do while loop

do{

//This line prompts user for input

cout<<"Numbers greater than 0: ";

//This line gets input from the user

cin>>num;}

while(num<1);//This condition checks for valid user input

cout<<"You entered: "<<num; //This line prints out the user input

}

2. Invalid values include: Odd Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Even Numbers: "; //This prompts user for even numbers

Replace

while(num<1);

with

while(num%2==1); //This checks if input is odd. If yes, the loop is repeated

3. Invalid values include: Even Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Odd Numbers: "; //This prompts user for Odd numbers

Replace

while(num<1);

with

while(num%2==0); //This checks if input is even. If yes, the loop is repeated

8 0
3 years ago
Which formula is used to measure accuracy?
Westkost [7]

Answer:You can only find REaccuracy if you know the actual “true” measurement… something that's difficult to do unless you're measuring against the atomic clock. The formula is: REaccuracy = (Absolute error / “True” value) * 100%.

Explanation:

7 0
3 years ago
Create a table in your own database using the following statement.
neonofarm [45]

Answer:

Check the explanation

Explanation:

CREATE FUNCTION dbo.DateRange_sp4 ("at"StartDate DATE, "at"NumberofConsecutivedays INT) RETURNS "at"DateList TABLE ( DateID INT IDENTITY, DateValue DATE, Year SMALLINT, Quarter SMALLINT, Month SMALLINT, Week SMALLINT, DayOfWeek SMALLINT ) AS BEGIN DECLARE "at"Counter INT = 0; WHILE ("at"Counter < "at"NumberofConsecutivedays) BEGIN INSERT INTO "at"DateList VALUES ("at"Counter + 1, DATEADD(DAY, "at"Counter, "at"StartDate), DATEPART(YEAR, "at"StartDate), DATEPART(QUARTER, "at"StartDate), DATEPART(MONTH, "at"StartDate), DATEPART(WEEK, "at"StartDate), DatePart(WEEKDAY, "at"StartDate) ); SET "at"StartDate = DATEADD(day,"at"Counter + 1, "at"StartDate); SET "at"Counter += 1 END RETURN; END GO SELECT * FROM dbo.DateRange_sp4('2020-01-10', 20);

kindly check the screenshot below

7 0
3 years ago
Other questions:
  • Is printer an input device​
    5·1 answer
  • Write a method called evenBeforeOdd that accepts an array of integers and rearranges its elements so that all even values appear
    15·1 answer
  • Does it matter if watch comes without box and papers
    10·1 answer
  • What 3 types of technologies are used inside hard drives?
    15·1 answer
  • Sally is editing her science report about living things. She needs to copy a paragraph from her original report.
    15·2 answers
  • Suppose you have a tablet with a capacity of gigabytes. For a plain text​ book, one byte typically corresponds to one character
    6·1 answer
  • Help, I'm a beginner in coding! I have to write a quiz. You don't have to get all fancy and stuff, since I'm a beginner lol. I w
    12·1 answer
  • Test unit 8 edhesive answers ​
    15·1 answer
  • Which method can be used for making a robot perform a different set of functions?
    13·1 answer
  • Explain employment opportunities in the networking field 
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!