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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started