D prevent the formation of rust
D. only the first title slide in the presentation.
Please provide the language you're using when you ask for programming help, otherwise you aren't going to get the answer that you are looking for.
Here it is in Java, and I'm assuming the number is given via user input? Otherwise, just remove the user input function and replace the integer with a value of your choice. Note, that this isn't the full code; only what is relevant to the question.
public static void main(String[] args) {
int num = numInput(10);
printDoubles(num, 100); // You can create a user input function for
// maxValue if you wanted to.
}
/**
* Receives user input between 0 and the absolute value of maxInput.
* @param maxInput The largest absolute value that can be input.
*/
private static int numInput(int maxInput) {
Scanner sc = new Scanner(System.in);
maxInput = Math.abs(maxInput);
int num = 0;
while (!(num > 0 && num <= maxInput)) {
num = sc.nextInt();
if (!(num > 0 && num <= maxInput)) {
System.out.println("Input too small or too large");
}
}
return num;
}
/**
* Continues to print out num doubled until maxValue is reached.
* @param num The number to be printed.
* @param maxValue The maximum value (not including in which num can be doubled to.
*/
private static void printDoubles(int num, int maxValue) {
if (num >= maxValue) {
System.out.println("No output.");
}
while (true) {
if (num >= maxValue) {
break;
}
if (num < maxValue) {
System.out.print(num + " ");
}
num *= 2;
}
System.out.println();
}
Explanation there is the rest in comments
A function call utilizing print-sum to print the sum of x and 400 is
print-sum(x, 400)
<h3>What is sum, exactly?</h3>
- A summation, also known as a sum, is the outcome of adding two or more numbers or quantities.
- There are always an even number of terms in a summation. There could be only two terms, or there could be one hundred, thousand, or a million.
- There are summations with an infinite number of terms. SUM Single User Monitor is its full form.
- The idea of the sum of four stresses the notion that there are numerous—if not infinite—ways to achieve particular outcomes, objectives, aspirations, or locations.
- To total the numbers, choose a cell next to them, choose AutoSum from the Home menu, and then press Enter.
To learn more SUM, refer to:
brainly.com/question/20203147
#SPJ4