Is this computer science?
If so, then the function you would need for your code is this...
_____
if (someValue%2 != 0) {
value *= -1;
}
_____
//basically <u>number%2 == 0</u> means even so "!" means false so "not even" meaning "odd."
Assuming you are doing an array list (given a set value) or a for-loop with an
int someValue = Integer.parseInt(args[i]); inside (not given a set value and not restricted)
Otherwise ignore me....lol
Answer:
import java.util.Scanner;
public class num8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter the mass");
double mass = in.nextDouble();
double weight = calWeight(mass);
System.out.println("The weigth is "+weight);
}
static double calWeight(double mass){
double weight = mass*9.80665; // assume a = accelation due to gravity = 9.80665N
if(weight>500){
System.out.println("Too Heavy");
}
else if(weight<100){
System.out.println("Too Light");
}
return weight;
}
}
Explanation:
- Using Java programming language
- The main method is created to request and store a variable, mass in kilogram. The main method call calWeight() and passes the value for mass
- A method calWeight() is created that calculates the weight in newtons (mass * 9.8).
- The method checks if the weight is greater than 500 (prints too heavy) if less than 100(prints to light)
- Returns the weight
Because, they are all required to configure to it to be recognized by an operating system.
Explanation:
It is the Operating System Software that instructs the hardware and puts them together to work well. When the manufacturer does not configure the device to be recognized by an operating system, then it will not work with other components.
Example.
If an Apple machine's sound card is being put in an HP machine which uses Microsoft designed operating system, won't work due to the operating system that the sound card has been designed for.
Answer:
Various types of application software are being mentioned below. And these are being made by software development companies both large, mid-level and small, as well as by independent programmers.
- Spreadsheet Software
- Word processing software
- Email Programs
- Internet Browsers
- Communication Software
- Database Software
- Presentation Software
- Desktop Publishing Software
Explanation:
Please check the answer section.