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
notka56 [123]
3 years ago
14

Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is le

ss than or equal to the second integer.
Computers and Technology
1 answer:
Lubov Fominskaja [6]3 years ago
3 0

Answer:

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter two integer numbers");

       int num1 = in.nextInt();

       int num2 = in.nextInt();

       int newSum=num1+10;

       System.out.println("The first number is "+num1);

       do{

          System.out.println(newSum);

          newSum +=10;

       }while (newSum <=num2);

   }

}

Explanation:

Using Java Programming language

  1. Prompt user for the two inputs and save them as num1 and num2(Using the scanner class)
  2. Create a new Variable newSum = num1+10
  3. Create a do...while loop to continually print the value of newSum, and increment it by 10 while it is less or equal to num2
You might be interested in
(true or false) A setter or getter method in object-oriented programming is an example of encapsulation.
marusya05 [52]

Answer:

True.

Explanation:

Encapsulation wraps and bundle data under a single data(so external access to such variable outside of the class is restricted). Getter and Setters are functions that gets and sets a specific value within your object class. If you override the setter and getter function within the class(and not declare it in primary constructor), it allows to store and bind specific information about data inside the class.

5 0
3 years ago
Any song recommendations, pls dont say 6ix9ine or lil pump
gogolik [260]

I actually do have one tho. Try Megan Tha Stallion.

8 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly. Which language should you use to add functionality to web pages?
lubasha [3.4K]

The language that you will use to  add functionality to web pages is JavaScript.

<h3>What is JavaScript?</h3>

JavaScript is known to be a tool that is often used in a lot of ways.

It is used by in web development by Web developers as they are said to use this language to input interactive elements in websites.

Therefore, The language that you will use to  add functionality to web pages is JavaScript.

Learn more about functionality from

brainly.com/question/25638609

#SPJ1

5 0
3 years ago
C++ Language Use functions to solve all problems in the mentioned assignment
alexdok [17]

Answer:

Following are the program to this question:

Q1:

#include <iostream> //including header file

using namespace std;

int main() //defining main method

{

   int m,n,i; //defining integer variable

   cout<<"Enter starting value: "; //print message

   cin>>m; //input m variable value

   cout<<"Enter ending value: ";//print message

   cin>>n;//input n variable value

   for(i=m;i<=n;i++) //defining loop to count even number  

   {

       if(i%2==0) //check even number condition

       {

           cout<<i<<" "; //print value

       }

   }

   return 0;

}

Q2:

#include<iostream> //include header file

using namespace std;

void menu() //define method menu

{

cout<<"Enter 1 for print your name and id: "<<endl; //print message

cout<<"Enter 2 for sum of odd numbers from 1 to 20: "<<endl;//print message

cout<<"Enter 3 for reverse of any number: "<<endl;//print message

cout<<"Enter 4 for exit"<<endl;//print message

}

void findsum() //define method findsum

{

int s=0,i; //defining integer variable

for(i=1;i<=20;i++) //defining loop to count odd number  

{

s=s+i; //add numbers

}

cout<<"Odd number sum from 1 to 20: "<<s; //print value

}

void revers() //defining method revers

{

int n,r,rev=0; //defining integer variable

cout<<"enter any number: "; //print message

cin>>n; //input value

while(n!=0) //define loop to reverse value

{

r=n%10; //store value in r variable

rev=(rev*10)+r; //add reverse value

n=n/10; //divide digit

}

cout<<"The reverse of a given number is: "<<rev; //print reverse value

}

int main() //defining main method

{

int c,rn; //defining integer variable

char n[30]; // defining char variable

menu(); //calling menu method

cout<<"Enter your selected choice: "<<endl; //print message

cin>>c; //input value in char variable

switch(c) //defining switch

{

   //defining case

case 1: cout<<"Enter your name: "<<endl; //print message for input name and id  

       cin>>n;//input name

       cout<<"Enter registration number: "<<endl; //print message  

       cout<<"Name: "<<n<<endl; // print name value

       cout<<"Registration number: "<<rn<<endl; // print id value

   break;

case 2: findsum(); //calling findsum method

   break;

case 3: revers(); //calling reverse method

   break;

case 4: exit(1); // calling exit method

   break;

default: cout<<"please enter valid choice"; //defining default choice

   break;

}

return 0;

}

Q3:

#include <iostream>//defining header file

using namespace std;

void reverse() //defining method readInput

{

  char x; //defining char variable

  cout<<"Enter a character: "; //print message

  cin>>x; //input value

  if(x=='.') //defining condition that check value is .  

   return; //using return keyword

  reverse(); //calling readInput method

  cout<<x; //print value

}

int main() //defining main method

{

  reverse(); //calling readInput method

return 0;    

}

Output:

please find the attachment.

Explanation:

Description of the given question as follows:

  • In question 1, three integer variable "m, n and i" is declared, in which variable "m and n" is used in user input, and variable "i" is used a loop to print even number from the user input values.
  • In question 2, a menu method is declared that prints a list menus in the next line, two methods "findsum() and revers()"is declared, in which "findsum" method is used to add odd values from 1 to 20 and the revers method is used to reverse value from an input digit. In the last line main method is declared, which uses switch to call the above methods.
  • In question 3, in this, a reverse method is defined, in which a char variable x is declared that input char value and define if block to check if char is equal to (.) if this is correct it will print the value in reverse order.

7 0
3 years ago
The principal objectives of computer security are to prevent unauthorized users from gaining access to resources, to prevent leg
Lena [83]

Answer:

True is the correct Answer for the above question.

Explanation:

  • Computer security is a security in which data of the computer is secured from the access of unauthorized users. It is primarily achieved to stop the access grant to the unauthorized user.
  • It means that there is an authorization point which decides that the user is authorized or not. If the user is authorized then only he can enter the system otherwise he can not able to enter the system.
  • It helps to secure the data and the data is the important point of the computer system.
  • The question also states the same which is described above. Hence true is the correct answer.

3 0
3 years ago
Other questions:
  • Write a program that estimates the approximate number of times the user’s heart has beat in his/her lifetime using an average he
    12·1 answer
  • ASAP
    12·2 answers
  • Which of the following is a type of monitor port?
    10·1 answer
  • The rules that determine what is allowed in a program are known as the
    14·1 answer
  • Alex builds a 1 GHz processor where two important programs, A and B, take one second each to execute. Each program has a CPI of
    6·1 answer
  • You are an ISP. For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there
    6·1 answer
  • Which language paradigm interacts well with database systems in business environments that use SQL? (I WILL GIVE BRAINLIEST TO T
    11·1 answer
  • FREE BRAINLIEST!!!!
    7·2 answers
  • 3.4.6 colorful bracelet ?
    5·1 answer
  • Simple example of hybrid computer​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!