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
sukhopar [10]
2 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]2 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 of the following is not true of how computers represent complex information
mote1985 [20]

Answer: c. Depending on context the same sequence of bits may represent different types of information.

Explanation:

The options for the question are:

A. Computing devices use patterns of bits to represent complex information

B. Abstraction helps represent complex information by surfacing complexity that might otherwise be hidden

C. Depending on context the same sequence of bits may represent different types of information

D. Common abstractions that are represented by computing devices include numbers, characters, and color.

The following are true of how computers represent complex information:

• Computing devices use patterns of bits to represent complex information

• helps represent complex information by surfacing complexity that might otherwise be hidden

• Common abstractions that are represented by computing devices include numbers, characters, and color.

Therefore, the option that is not true of how computers represent complex information is that "depending on context the same sequence of bits may represent different types of information".

5 0
1 year ago
Read 2 more answers
Given the dictionary, d, find the largest key in the dictionary and associate the corresponding value with the variable val_of_m
geniusboy [140]

Answer:

Here is the Python program:

d = {5:3, 4:1, 12:2}

val_of_max = d[max(d.keys())]

print(val_of_max)

Explanation:

The program works as follows:

So we have a dictionary named d which is not empty and has the following key-value pairs:

5:3

4:1

12:2

where 5 , 4 and 12 are the keys and 3, 1 and 2 are the values

As we can see that the largest key is 12. So in order to find the largest key we use max() method which returns the largest key in the dictionary and we also use keys() which returns a view object i.e. the key of dictionary. So

max(d.keys()) as a whole gives 12

Next d[max(d.keys())]  returns the corresponding value of this largest key. The corresponding value is 2 so this entire statement gives 2.

val_of_max = d[max(d.keys())] Thus this complete statement gives 2 and assigns to the val_of_max variable.

Next print(val_of_max) displays 2 on the output screen.

The screenshot of program along with its output is attached.

4 0
2 years ago
What is a commonly publicized password sql injection string?
aleksley [76]
The strings "or 1=1" and ""or ''=''"  can be commonly used to trick an SQL WHERE clause into becoming true.

So if you specify <span>' or ''=' as a password, you can log in if the query string would be:

</span><span>select username,pass from users where username='you' and password='' or ''='<span>' limit 0,1;</span></span>
7 0
2 years ago
Write a for loop that iterates from 1 to numbersamples to double any element's value in datasamples that is less than minvalue.
CaHeK987 [17]

Answer:

function dataSamples=AdjustMinValue(numberSamples, userSamples, minValue)

dataSamples=userSamples;

%for loop

for i=1:numberSamples

%checking if dataSamples value at index,i

%is less than minValue

if dataSamples(i)<minValue

%set double of dataSamples value

dataSamples(i)= 2*dataSamples(i);

end

end

end

Explanation:

The given code is in MATLAB.

4 0
1 year ago
By specifying a(n) ____ specifically for handheld devices, you can customize the page layout such as by designing the content to
antoniya [11.8K]

Answer:

Style sheet.

Explanation:

A website is a collection of web pages. Web development tools are mainly HTML,CSS and JavaScript. They have their individual functions in structuring a web page.

JavaScript is a purpose object oriented programming language widely used in web page for writing scripts, aimed to make web pages interactive.

HTML is a mark-up language which provides a non-linear structuring approach to web page development.

CSS or cascaded style sheet is a tool used to design the element and layout of web pages on a device screen.

7 0
2 years ago
Other questions:
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • Given an integer variable strawsOnCamel, write a statement that uses the auto-increment operator to increase the value of that v
    12·1 answer
  • Consider a maximal flow problem in which vehicle traffic entering a city is routed among several routes before eventually leavin
    7·1 answer
  • Software as a Service (SaaS) refers to the use of computing resources, including software and data storage, on the Internet rath
    13·1 answer
  • How has the perception of the hacker changed over recent years? What is the profile of a hacker today?
    5·1 answer
  • You realize your computer has been infected with malware. It seems as if someone is controlling your computer from a remote loca
    5·1 answer
  • __________ access control is a form of __________ access control in which users are assigned a matrix of authorizations for part
    8·1 answer
  • Lin is booting up his computer, and during the boot process, the computer powers down. After several unsuccessful attempts to bo
    13·1 answer
  • Write the addReview method, which adds a single product review, represented by a ProductReview object, to the ReviewCollector ob
    6·1 answer
  • Jen is trying to discover if a motor has failed windings. What sort of test can she do.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!