Question: Write a program in Java for the following : 1) Write a Java program that asks the user to input a positve number(n) and displays

Write a program in Java for the following :

1) Write a Java program that asks the user to input a positve number(n) and displays the value of: 0.1+(0.1)^2+(0.1)^3+....(0.1)^n

2) Write a Java program that reads a string from the command line and checks it against two conditions.

Condition 1: check if the length of string=10

Condition 2:check if the string begins with A

If both conditions are satisfied, then print "length=10 and string begins with A".

If both are not satisfied, then print " neither conditions are satisfied". If either one is satisfied, then print " only one condition is met".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!