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
juin [17]
2 years ago
15

Write a program that takes a single integer input from the user and stores it in a variable. Your program should increase the va

lue of this variable by one three times, printing "number is now " followed by its value each time, then decrease it by one three times, again printing "number is now " and the value each time
Computers and Technology
1 answer:
Allushta [10]2 years ago
8 0

Answer:

Question is answered using python:

num = int(input("User Input: "))

for i in range(3):

    num = num+1

    print("Number is now "+str(num))

for i in range(3):

    num = num-1

    print("Number is now "+str(num))

Explanation:

This line prompts user for input

num = int(input("User Input: "))

The following iterates from 1 to 3

for i in range(3):

This increments user input each time

    num = num+1

This prints the value of num after increment

    print("Number is now "+str(num))

The following iterates from 1 to 3

for i in range(3):

This decrements the value of num

    num = num-1

This prints the value of num after decrement

    print("Number is now "+str(num))

You might be interested in
enter a formula in cell b10 to return a value of 35000 if the net profit after tax (cell B() is greater than or equal to 350000
Aliun [14]

Step by step explanation:

Statement to be written in cell B10 :

IF ( B9 >= 350000 , 35000, 1000)

Formula:

IF ( logical_test ,  [value_if_true] ,  [value_if_false] )

logical_test = Net Profit After Tax (cell B9)

value_if_true = 35000

(if the Net Profit After Tax (cell B9) is greater than or equal to 350000)

    value_if_false = 1000

(if the Net Profit After Tax (cell B9) is lesser than 350000)


6 0
2 years ago
Read 2 more answers
Write a program that asks the user to enter a name, and then prints
Digiron [165]

Answer:

user_name = input("Please enter a name or type Nope to terminate the program: ")

while( user_name != "Nope" ):

   print("Nice to meet you ", user_name )

   user_name = input("Please enter a name or type Nope to terminate the program: ")

Explanation:

Get the name from user as an input and store it in the user_name variable.

Run a while loop until user_name is not equal to the value of Nope.

Inside the while loop, display the name of user and repeat the question until user types Nope.

6 0
2 years ago
Read 2 more answers
Create a program to deteate a program to determine whether a user-specified altitude [meters] is in the troposphere, lower strat
allsm [11]

Answer:

#include <iostream>

using namespace std;

int main()

{

   float altitude;

   cout<<"Enter alttitude in meter";

cin >>altitude;

if(altitude<0 || altitude > 50000)

{

   cout<<"Invalid value entered";

   return 0;

}

else{

   if(altitude<= 10000)

   {cout <<"In troposphere "<<endl;}

   

   else if(altitude>10000 && altitude<=30000)

   {cout <<"In lower stratosphere"<<endl;}

   

   else if(altitude>30000 && altitude<=50000)

   {cout <<"In upper stratosphere"<<endl;}

   

}

   return 0;

}

Explanation:

Define a float type variable. Ask user to enter altitude in meters. Store value to altitude variable.

Now check if value entered is positive and less than 5000,if its not in the range of 0-50,000 display a termination message and exit else check if it's in less than 10000, in between 10000 and 30000 or in between 30000 and 50000.

10,000 is above sea level is troposphere.

10,000-30,000 is lower stratosphere.

30,000-50,000 is upper stratosphere.

8 0
2 years ago
Your Economics teacher has asked you to create a chart showing how supply and demand affects the price of gasoline. Which applic
Evgesh-ka [11]
YOU SHOULD USE EXCEL, HOPE THAT HELPS :)
6 0
2 years ago
Read 2 more answers
Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 100 milliseconds
GrogVix [38]

Answer:

var count = 0;

var counterElement = document.getElementById("counter");

counterElement.innerHTML = count;

var interval = setInterval(function () {

   count++;

   counterElement.innerHTML = count;

   if (count === 4) {

       clearTimeout(interval);

   }

}, 100);

Explanation:

6 0
2 years ago
Other questions:
  • Computer design software requires __________________ to be used properly and successfully by architects.
    9·2 answers
  • Whoever helps me with these questions i will help them with the same number of questions in any subject: 1. As the operations ma
    14·1 answer
  • Kleene star of {1} generates {1, 11, 111, 1111, 11111……}.<br> True<br> False
    12·1 answer
  • Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message
    14·1 answer
  • For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
    7·1 answer
  • You have been employed as a technical consultant to a computer shop chain. You are given the task of creating a short consumer b
    12·1 answer
  • Which of the following are true statements about the data that can be represented using binary sequences?
    5·1 answer
  • +10 points~~~Which option is used in emails to inform the recipient that they should exercise discretion in accordance with shar
    12·1 answer
  • When should a developer begin thinking about scalability? 1 during the design phase 2during testing 3when traffic increases by 2
    14·1 answer
  • Which of the following stakeholders makes policies for a green economy?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!