Need Help With Some Pyramid
Hello Bro
First : My Code Is Not Displaying ¥¥ It Displays ? Insted What Is The Soulotion
Second : I Have Coded The Second Code To Display "Z" in comment but it dose not
Thired : Soulotion to display that Thirde Code In The Comment
My Last Question : Soulotion To Take Integer And Double And A String And Store In A File And Then Read It and Must Diplay The Sum Of Integer And Double
Thanks Lot
public class PrintAnimalPattern {
public static void main (String args[]){
/*
'__'
(©©)
/========\/
/ || %% ||
* ||----||
¥¥ ¥¥
"" ""
*/
System.out.print("\t "+"'__'");
System.out.println();
System.out.println("\t "+"(©©)");
System.out.print(" "+"/"+"========"+"\\/");
System.out.println();
System.out.print("/"+" || %% || ");
System.out.println();
System.out.print("*"+" ||----|| ");
System.out.println();
System.out.print(" "+" ¥¥ ¥¥ ");
System.out.println();
System.out.print("\u00a5");
}
}
================================================== ==========
public class PrintPattern5 {
public static void main (String args[]){
/*
# # # # # # #
#
#
#
#
#
# # # # # # #
*/
for (int i=1;i<=7;i++) {
System.out.print(" "+"#");
}
System.out.println();
for (int i=2;i<=6;i++) {
System.out.println(" "+"#");
}
for (int i=1;i<=7;i++) {
System.out.print(" "+"#");
}
}
}
================================================== ============
public class PrintPattern3 {
public static void main (String args[]){
/*
# # # # # # # #
# # # # # # #
# # # # # #
# # # # #
# # # #
# # #
# #
#
*/
for (int i=7; i >= 0; i--) {
for (int j=3; j <= i; j++) {
System.out.print(" "+"#");
}
System.out.println();
}
}
}
================================================== =============
import java.io.*;
import java.util.Scanner;
public class FileIO{
public static void main(String args[])throws IOException{
/*
The integer read is 12 num1
The floating point number read is 33.44 num2
The String read is "Peter" name
Hi! Peter, the sum of 12 and 33.44 is 45.44 sum
*/
int num_1;
double sum;
//double num;
//String name;
Scanner keyboard = new Scanner(System.in);
FileWriter file = new FileWriter("in.txt");
PrintWriter pr = new PrintWriter(file);
for(int i=1;i<=2;i++){
System.out.println("Integer");
num_1=keyboard.nextInt();
pr.println(num_1);
/*
System.out.println("double");
num=keyboard.nextdouble();
pr.println(num);
System.out.println("string");
name=keyboard.next();
pr.println(name);
}
*/
pr.close();
System.out.println("data has been written");
FileReader out=new FileReader("in.txt");
BufferedReader rd=new BufferedReader(out);
String read=rd.readLine();
while(read!=null){
System.out.println(read);
read=rd.readLine();
System.out.println(read);
}
out.close();
}
}
}
Re: Need Help With Some Pyramid
Quote:
Originally Posted by
lord raza
My Code Is Not Displaying ¥¥ It Displays ? Insted What Is The Soulotion
There is nothing wrong in your code, it should display it properly.
I guess it's your settings somewhere, and I think that it has nothing to do with java.
About the rest of your code, I'm not going to read it.
If you want to get help atleast use the code tag so we can read it properly and help you.