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
sukhopar [10]
4 years ago
10

Print "userNum1 is negative." if userNum1 is less than O. End with newline Convert userNum2 to 0 if userNum2 is greater than 8.

Otherwise, print "userNum2 is less than or equal to 8.. End with newline. 1 public class UserNums 2public static void main (String args) int userNum1; int userNum2 userNumt - -1; userNum2 7; Your solution goes here / 10 System.out.printin("userNum2 is "userNum2);
Computers and Technology
1 answer:
Butoxors [25]4 years ago
8 0

Answer:

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter User name 1 and 2");

       int userNum1 = in.nextInt();

       int userNum2= in.nextInt();

       if(userNum1<0){

           System.out.println("userNum1 is negative.");

       }

       else if(userNum2>8){

           userNum2 =0;

       }

       else{

           System.out.println("userNum2 is less than or equal to 8..");

       }

   }

}

Explanation:

This is implemented in Java programming language

Using the scanner class, the user is prompted to enter two numbers

These are saved in the variable userNum1 and userNum2 respectively.

If, else if and else statements are then used according to the specifications given in the question.

You might be interested in
Which layer of the osi model is mainly concerned with routing packets of data from one network card to another across a large ne
horrorfan [7]
Layer 3 the Network Layer
7 0
3 years ago
5.18 LAB: Output numbers in reverse Write a program that reads a list of integers, and outputs those integers in reverse. The in
Rina8888 [55]

Answer:

In C++:

#include<iostream>

#include<vector>

using namespace std;

int main(){

   int len, num;

   vector<int> vect;

   cout<<"Length: ";

   cin>>len;  

   for(int i = 0; i<len;i++){

       cin>>num;

   vect.push_back(num);}

   vector<int>::iterator iter;

   for (iter = vect.end() - 1; iter >= vect.begin(); iter--){

       cout << *iter << ", ";}    

}

Explanation:

This declares the length of vector and input number as integer

   int len, num;

This declares an integer vector

   vector<int> vect;

This prompts the user for length  

cout<<"Length: ";

This gets the input for length  

   cin>>len;  

The following iteration gets input into the vector

<em>    for(int i = 0; i<len;i++){</em>

<em>        cin>>num;</em>

<em>    vect.push_back(num);}</em>

This declares an iterator for the vector

   vector<int>::iterator iter;

The following iterates from the end to the beginning and prints the vector in reverse

<em>    for (iter = vect.end() - 1; iter >= vect.begin(); iter--){</em>

<em>        cout << *iter << ", ";}</em>

<em />

<em />

6 0
3 years ago
I need help, thank you
BabaBlast [244]

Answer:

umm I think it's C it's between that one and d so the 1st and 4th but leaning more towards C

6 0
3 years ago
How do I make a game from scratch, what program should I use, and what tutorial should I follow, I want to make a 2D platformer
Yuliya22 [10]
Honestly just buy a decent GUI and gets scripts for other games and piece it together it’s how was made
7 0
3 years ago
Storage system that uses lasers to read data
tatuchka [14]

I believe it is an optical storage system that uses lasers to read data.

5 0
4 years ago
Read 2 more answers
Other questions:
  • What is the most important part of the course that you have learned about so far?
    11·2 answers
  • Janae started an essay on the computer at school. She would like to work on it when she gets home, but she does not have a flash
    7·2 answers
  • The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan
    11·1 answer
  • A contact list is a place where you can store a specific contact with other associated information such as a phone number, email
    8·1 answer
  • A _____ miniature battery operated transmitter that can be propelled through a non-metallic pipe or purpose of locating
    6·1 answer
  • Which of the following software programs provides for e-mail communication?
    5·1 answer
  • PLzzzzzz help me!! I will mark brainiest to the one who answers it right!!
    14·1 answer
  • 50 POINTS
    6·1 answer
  • To input lenth in meter and convert in to centimeter​
    6·1 answer
  • 1. Microsoft Excel, MS Excel, or simply Excel is a______application by Microsoft Corporation. 2. Excel allows you to organize an
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!