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;
}
Click options in the tools menu and select track changers
Answer:
Explanation:
The following code is written in Java and uses a for loop with a series of IF ELSE statements to check the next and previous characters in a string. Checking to make sure that there are no asterix. If so it adds that character to the String variable output. Which is returned to the user at the end of the method. Two test cases have been created and the output can be seen in the attached image below.
class Brainly {
public static void main(String[] args) {
System.out.println(starOut("sm*eilly"));
System.out.println(starOut("ab**cd"));
}
public static String starOut(String str) {
String output = "";
for (int i = 0; i < str.length(); i++) {
if ((i != 0) && (i != str.length()-1)) {
if ((str.charAt(i-1) != '*') && (str.charAt(i+1) != '*') && (str.charAt(i) != '*')) {
output += str.charAt(i);
}
} else {
if ((i == 0) && (str.charAt(i) != '*') && (str.charAt(i+1) != '*')) {
output += str.charAt(i);
} else if ((i == str.length()-1) && (str.charAt(i) != '*') && (str.charAt(i-1) != '*')) {
output += str.charAt(i);
}
}
}
return output;
}
}
The notes in computer code for the programmer that are ignored by the compiler is called a comment.
<h3>What are codes in programming?</h3>
Codes in programming are specific sequences or sets of instructions that are made for specific programs. They are written in a specific language. They are made to make a human-friendly language. Codes are made after the compiler confirms them.
Comments are written for the document. They tell what the document is for, and how the document is constructed.
Thus, the notes on the computer code for the programmer are called a comment.
To learn more about comments in computer code, refer to the link:
brainly.com/question/18340665
#SPJ4