Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

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

Given an array myArray of numbers, write a function to square the alternate numbers of the myArray, starting from index 0 using the array method map.Input

  • The input will be a single line containing an array myArray

Output

  • The output should be a single line containing an array with alternate numbers squared

Constraints

  • Each value in the array must be a number

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 9


You 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:

  1. Input three integers in different lines (one each line).
  2. Print out the integers in one line.
  3. If the 1st integer is greater than or equal to both the 2nd integer and the 3rd integer, print "Yes".

Instructions

  1. Input three integers in different lines (one each line).
  2. Print out the integers in one line.
  3. If the 1st integer is greater than or equal to both the 2nd integer and the 3rd integer, print "Yes".

Input

Three lines containing an integer on each.

3
2
1

Output

The first line contains all the three inputted integers.

The second line contains a string which is the result.

3·2·1
Yes

I'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.


4. Decimal x Decimal

by CodeChum Admin

Now that we're done with integers, we're moving on to decimals!


Instructions:

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Instructions

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Input

A line containing three decimal numbers with two decimal places separated by a space.


1.53·2.25·1.23

Output

A line containing the result with two decimal places.


2.80
LATEST TUTORIALS
APPROVED BY CLIENTS