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
TEA [102]
2 years ago
7

Write a complete program that declares an integer variable

Computers and Technology
1 answer:
Fed [463]2 years ago
3 0

Answer:

Java:

import java.util.Scanner;

public class Main {

 public static void main(String[] args) {

   Scanner sc = new Scanner(System.in);

   int number = sc.nextInt();

   System.out.println(number + " " + number*2 + " " + number**2);

 }

}

Python:

num = int(input("Number: "))

print(num+" "+num*2+" "+num**2)

C++:

#include <iostream>

int main() {

 int number;

 std::cin >> number;

 std::cout << num << " " << num*2 << " " << num**2;

 return 0;

}

You might be interested in
Design and implement a set of classes that define various types of reading material: books, novels, magazines, technical journal
tino4ka555 [31]

Answer:

Following are the code to this question:

please find the attached file.

Explanation:

In this code, four class "novels, magazines, technical journals, and textbooks", is defined, in which it holds their respective default constructor and the get and set method to hold the string and integer value, and in the book class the main method is defined, that creates its object and a switch to for search value and print its value.

6 0
3 years ago
Which RFC reserves three ranges of IP addresses for private use - a single Class A (10.0.0.0-10.255.255.255), 16 Class Bs (172.1
erica [24]

Answer:

The answer is "1918".

Explanation:

The RFC stands for "remote function call", it is also known as an abbreviated form. It is an application, that responses in a technical online design Task Force, it is also known as a document, which was prepared for review by shareholders to collects some information.  

The RFC reverses is also known as an idea, that uses IP version 4 to reverse the IP address, this process is done by TCP/IP protocol, which is defined under RFC 1918.  

4 0
3 years ago
Five features of any window​
Vesna [10]

Answer:

The features of any windows are

1. Start menu

2. Notification area or task bar

3. Window snipping tools

4. Using Local Area Networks

5. Windows explorer libraries

Explanation:

8 0
2 years ago
Just a quick question, how do you set something == to char and int in an if statement (java)
Troyanec [42]

This is the requested code in java.

public class <em>CharTest</em> {

   public static String checkCharacter(String text, int index) {

       if (0 <= index && index <= text.length()) {

           char ch = text.charAt(index);

           if (Character.isLetter(ch)) {

               return ch + " is a letter";

           } else if (Character.isDigit(ch)) {

               return ch + " is a digit";

           } else if (Character.isWhitespace(ch)) {

               return ch + " is a whitespace character";

           } else {

               return ch + " is an unknown type of character";

           }

       } else {

           return "index " + index.toString() + " is out of range";

       } // <em>end if</em>

   } // <em>end function checkChar()</em>

   public static void <em>main</em>(String[] args) {

       // <em>Test the three samples from the specification.</em>

       System.out.println(<em>checkCharacter</em>("happy birthday", 2));

       System.out.println(<em>checkCharacter</em>("happy birthday", 5));

       System.out.println(<em>checkCharacter</em>("happy birthday 2 you", 15));

   } // <em>end function main()</em>

} // <em>end class CharTest</em>

The function <em>checkcharacter</em>(text, index) returns a string value describing the kind of character found at the position in text specified by index; whether it was a letter, digit, whitespace, or an unknown kind of character.

How it does that is to make use of respective functions defined within the Character class in java. That is

  • isLetter(char) returns a bool specifying if the char parameter is a letter.
  • isDigit(char) returns a bool specifying if the char parameter is a digit.
  • isWhitespace(char) returns a bool specifying if the char parameter is a whitespace character.

It calls these functions in an if statement. These else part of the if statement is then executed if the character is neither a <em>letter</em>, <em>digit</em>, or <em>whitespace</em>.

Finally, the function main() calls <em>checkCharacter</em>() three times to test the function and return the results to the console.

Another example of a java program on characters is found in the link below

brainly.com/question/15061607

3 0
2 years ago
Janet has to create a web page for a software company that should be accessible from both desktop computers and mobile devices.
kenny6666 [7]

create a responsive website which adapts to every screen/devices. Answer is B.

3 0
2 years ago
Read 2 more answers
Other questions:
  • How to ask for a letter of recommendation via email?
    10·1 answer
  • You can use RWA to demonstrate how to do something special on the web, such as displaying articles found on websites that suppor
    15·1 answer
  • Heather has segmented all of the individuals in her database into four categories according to how many game tickets they purcha
    12·2 answers
  • Portable Document Format (PDF) is a file format that provides an electronic image of a document and can be viewed, printed, and
    12·2 answers
  • What is project management? A. Brainstorming ways to plan a project B. Executing, completing, and revising a project C. Managing
    10·1 answer
  • What is boolean rules​
    12·1 answer
  • What are the process of boots up a computer?​
    15·2 answers
  • Brainly is brainly am I correct ​
    11·2 answers
  • Brainliest to right answer.
    10·1 answer
  • 4.(L.5.1.A) Select the sentence that includes an interjection,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!