Problem:
Write a Java program that will convert a number(x) in base r to base 10.
The program should also meet the following requirements:
· Base r is an input and must be validated ; r is from 2 to 9 only
· The number x is an input and must be stored in an int type variable. Do not convert x to
string.
· Use of String type variable is not allowed.
· Use of arrays is not allowed.
· Use of built-in method that converts a given number to another base is not allowed.
· Your program should execute for as long as the user wants to continue
Assume that the user will input a valid number.
Note: This program converts X^r to Y^10
Where :
X^r - a number in base r
r – is from 2 to 9 only
Y^10 – the equivalent number in base 10
Square at Alternate Indices
Sample Input 1
[ 1, 2, 3, 4, 5 ]
Sample Output 1
[ 1, 2, 9, 4, 25 ]
Sample Input 2
[ 2, 4 ]
Sample Output 2
[ 4, 4 ]
Digit 9You are given
N as input. Write a program to print the pattern of 2*N - 1 rows using an asterisk(*) as shown below.Note: There is a space after each asterisk * character.Input
The first line of input is an integer
N.Explanation
In the given example,
sample input is 4
the output should be like this...
* * * *
* *
* *
* * * *
*
*
* * * *String Slicing: Given two strings inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString. Slice the inputString starting from the subString to the end of the inputString.
Input
The first line of input contains a string inputString
The second line of input contains a string subString
Output
The output should be a sliced string or inputString (if the inputString does not include the subString)
function main() {
let inputString = readLine();
const subString = readLine();
/* Write your code here */
}
i want code in between write code here
The first three lines will contain message prompts to input the three decimal numbers.
The last line contains the result in two decimal places.
They say that the one in first place is always greater than the one in the second and third place. Are they always right?
Instructions:
Instructions
Input
Three lines containing an integer on each.
3
2
1Output
The first line contains all the three inputted integers.
The second line contains a string which is the result.
3·2·1
YesI'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.
. Create a class Processor that has the following methods: a) InputStudentData: Gets the input for the Student object that has registration number, name, cgpa, and discipline as data members. b) PrintStudentData: Displays the students data on the console. c) StudentWithMaxGrade: Display the record of the student whose cgpa is maximum in the class. d) In Main() method take the inputs of 5 students and test the methods.
. Create a class Processor that has the following methods: a) InputStudentData: Gets the input for the Student object that has registration number, name, cgpa, and discipline as data members. b) PrintStudentData: Displays the students data on the console. c) StudentWithMaxGrade: Display the record of the student whose cgpa is maximum in the class. d) In Main() method take the inputs of 5 students and test the methods.
by CodeChum Admin
Now that we're done with integers, we're moving on to decimals!
Instructions:
Instructions
Input
A line containing three decimal numbers with two decimal places separated by a space.
1.53·2.25·1.23Output
A line containing the result with two decimal places.
2.80