Programming Practice For Begginners
Programming Practice For Begginners
MIT
Fall 2012
The difference between stupidity and genius is that genius has its limits. Albert Einstein
Homework 03
[String and Math Functions, General Programming Practice]
Note1: Output is made clear by showing boxes so that spaces can be counted.
Note2: Dont do hard coding in task use formulas and functions to generalize your programs.
Note3: In task 7 output on right hand side is of two different runs of the program
Task 1:
Complete code written inside main function to show output given on right hand side?
String space="
";
System.out.println("*");
System.out.println("*"+space.substring(0,0)+"*");
*
* *
*
*
*
*
*
*
*
*
* * * * * * *
Task 2:
Complete code written inside main function to show output given on right hand side?
String space="
";
System.out.println("*");
System.out.println("*"+space.substring(0,0)+"*");
*
*
*
*
*
*
*
* ** * * * * * *
and
A:2
B:5
C:3
X1:-1.0
A:4
B:9
C:5
X1:-1.0
X2:-1.5
X2:-1.25
Page 1 of 1