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
Romashka-Z-Leto [24]
2 years ago
13

Write code that prints: Ready! firstNumber ... 2 1 Run! Your code should contain a for loop. Print a newline after each number a

nd after each line of text Ex: firstNumber = 3 outputs:
Computers and Technology
3 answers:
daser333 [38]2 years ago
5 0

Answer:

//This program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

int main()

{

// Declare Variable

int firstNumber;

// Accept Input for firstNumber

cin>> firstNumber;

// Print firstNumber

cout<<"firstNumber = "<<firstNumber<<endl;;

//Start Loop

for(int i = firstNumber - 1; firstNumber>0; firstNumber--)

{

// Print iteration value

cout<<firstNumber<<endl;

}

// Print Run! at the end

cout<<"Run!";

return 0;

//End of Program

}

LUCKY_DIMON [66]2 years ago
3 0

Complete Question:

Write code that prints: Ready! userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after each line of text Ex: userNum = 3 outputs: Ready! 3 2 1 Blastoff!

Answer:

public class TestClock {

   public static void main(String[] args) {

       int userNum= 3;

       System.out.print("Ready! "+userNum+" ");

       for (int i=userNum;i>1; i--){

           userNum--;

           System.out.print(userNum+" ");

       }

       System.out.println("Blasoff!");

   }

}

Explanation:

  1. Create and initialize userNum
  2. Use System.out.print to print the sequence ("Ready! "+userNum+" ") on same line
  3. use for statement with this condition for (int i=userNum;i>1; i--) decremeent userNum by 1 after each loop iteration and print userNum on same line
  4. outside the for loop print "Blasoff!"
Guest1 year ago
0 0

#include <iostream>
using namespace std;

int main() {
int firstNumber;
int i;

cin >> firstNumber;

for(i = firstNumber; i>0; --i) {
if (i == firstNumber && i>0) {
cout << "Ready!" << endl;
cout << firstNumber << endl;
}
else if (i!= firstNumber && i>0){
firstNumber = (firstNumber-1);
cout << firstNumber << endl;
}
}
if (firstNumber<= 0){
cout << "Ready!" << endl;
}
cout << "Run!" << endl;
return 0;
}</iostream>

You might be interested in
Which data type change will require the app builder to perform the additional steps in order to retain existing functionalities?
Readme [11.4K]

Answer:

Option D is the correct option.

Explanation:

The following option is correct because the lead alteration from number to text and the number to text types of data will reconstruct the important number of the app builder to accomplish those steps which is extra to continue to have that functionality which is in the existence. That's why the app builder has to be reconstructed the types of data for the custom fields.

7 0
2 years ago
When should a developer begin thinking about scalability? 1 during the design phase 2during testing 3when traffic increases by 2
Tanzania [10]

Answer:

in my opinion 4

Explanation:

when the system is available to users

(sorry and thanks)

4 0
2 years ago
Suppose your company has decided that it needs to make certain busy servers faster. Processes in the workload spend 60% of their
vekshin1

Answer:

CPU need 50% much faster

disk need 100% much faster

Explanation:

given data

workload spend time CPU  = 60%

workload spend time I/O = 40%

achieve overall system speedup = 25%

to find out

How much faster does CPU need and How much faster does the disk need

solution

we apply here Amdahl’s law for the overall speed of a computer that is express as

S = \frac{1}{(1-f)+ \frac{f}{k} }      .............................1

here f is fraction of work i.e 0.6 and S is overall speed  i.e 100% + 25% = 125 % and k is speed up of component

so put all value in equation 1 we get

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.6)+ \frac{0.6}{k} }  

solve we get

k = 1.5

so we can say  CPU need 50% much faster

and

when f = 0.4 and S = 125 %

put the value in equation 1

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.4)+ \frac{0.4}{k} }  

solve we get

k = 2

so here disk need 100% much faster

7 0
2 years ago
Please help!! Caleb is working on a simple logic-based program to simulate a game of tic-tac-toe. Which programming language wou
irga5000 [103]

Basic language should do it

4 0
2 years ago
Consider the following relation:CAR_SALE(Car#, Date_sold, Salesperson#, Commission%, Discount_amt)Assume that a car may be sold
GalinKa [24]

Answer:

The answer to this question can be given as:

Normalization:

Normalization usually includes the division of a table into two or more tables as well as defining a relation between the table. It is also used to check the quality of the database design. In the normalization, we use three-level that are 1NF, 2NF, 3NF.

First Normal Form (1NF):

In the 1NF each table contains unique data. for example employee id.  

Second Normal Form (2NF):

In the 2NF form, every field in a table that is not a determiner of another field's contents must itself be a component of the table's other fields.

Third Normal Form (3NF):

In the 3NF form, no duplication of information is allowed.

Explanation:

The explanation of the question can be given as:

  • Since all attribute values are single atomic, the given relation CAR_SALE is in 1NF.  
  • Salesperson# → commission% …Given  Thus, it is not completely dependent on the primary key {Car#, Salesperson#}. Hence, it is not in 2 NF.                                                                                                        

The 2 NF decomposition:

        CAR_SALE_1(Car#, Salesperson#, Date_sold, Discount_amt)

         CAR_SALE_2(Salesperson#, Commission%)

  • The relationship in question is not in 3NF because the nature of a transitive dependence occurs
  • Discount_amt → Date_sold → (Car#, Salesperson#) . Thus, Date_sold is neither the key itself nor the Discount amt sub-set is a prime attribute.  

The 3 NF decomposition :

        CAR_SALES_1A(Car#, Salesperson#, Date_sold)

        CAR_SALES_1B(Date_sold, Discount_amt)

        CAR_SALE_3(Salesperson#, Commission%)

5 0
2 years ago
Other questions:
  • Which statement regarding dialogues in multiplayer games is true? Dialogues are based only on players’ actions.
    7·2 answers
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • PYTHON QUESTION
    15·1 answer
  • Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • An entrepreneur is opening a computer store in a small town and wants to display a few laptops in the store, but is concerned ab
    11·2 answers
  • Suppose that each row of an n×n array A consists of 1’s and 0’s such that, in any row i of A, all the 1’s come before any 0’s in
    15·1 answer
  • You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
    8·1 answer
  • The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator tha
    9·1 answer
  • They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
    8·1 answer
  • Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!