Results 1 to 7 of 7
  1. #1
    zaina is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Can any one help me ( jcreator )

    Program 1: Write a Program to print your Student details. Declare 3 variables:
    1.Your name( use String data type)
    2.Student number( use String data type)
    3.University( use String data type)
    The output should look like this
    •Student Name: Joe Francis
    •Student Number: BH0350031
    •University: AMA University

    Program 2: Write a program that declares the following variables:
    1.the first name of a friend(use variable “name”)
    2.a favorite Color, (use variable “color”)
    3.a favorite food, (use variable “food”
    4.a favorite animal (use variable “animal”)
    Then print the following.
    I had a dream that name ate a color animal and said it tasted like food.

    Program 3: Write a Program to print your Account details.
    Declare 3 variables
    1.Account name(use String data type, i.e. Savings or Current)
    2.Your name (use String data type)
    3.Balance (use int data type)
    The output should look like this
    Account Name: Savings
    Name: Mohammed
    Balance: 2500

    Program 4: Write a java program to find the sum of two given numbers and to display the output.[/LEFT][/LEFT][/LEFT]

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,522
    Blog Entries
    7
    Rep Power
    20

    Default

    Good; so you know what to do so start a.s.a.p. doing it; if you get stuck with something come back here and we'll try to help you but we're not going to do your homework for you.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    zaina is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    Q1-

    public class ZAINAB {

    public static void main(String[] args) {

    string Name,Student Number,University;
    system.out.println(Name: zainab Sayed Hameed)
    system.out.println(Student Number: BH10500790)
    system.out.print(University: AMA University)
    }
    }
    Out Put:
    Name: Zainab Sayeed Hameed
    Student Number: BH10500790
    University: AMA university
    Q3:

    public class ZAINAB {

    public static void main(String[] args) {

    system.out.println(Account Name:Saving)
    system.out.println(Name: Mohammed)
    system.out.print(Blance: 2500)
    }
    }
    Out Put:
    Account Name: Savings
    Name: Mohammed
    Blance: 2500

    I tried but i don't know if it true or not and i don't have any idea about Q2 :)



    public class ZAINAB {

    public static void main(String[] args) {

    int a=5;
    int b=10;
    c=a+b;
    system.out.println("the value if c is: a+b");
    out put:
    The value of c is : 15.0

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,522
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by zaina View Post
    Q1-

    public class ZAINAB {

    public static void main(String[] args) {

    string Name,Student Number,University;
    system.out.println(Name: zainab Sayed Hameed)
    system.out.println(Student Number: BH10500790)
    system.out.print(University: AMA University)
    }
    }
    Out Put:
    Name: Zainab Sayeed Hameed
    Student Number: BH10500790
    University: AMA university
    Let's start with that first question. Does your code compile? I'm sure it doesn't. I'll give away this first question, check my answer and try to figure out what you did incorrect:

    Java Code:
    public class ZAINAB {
    
        public static void main(String[] args) {
        
            String name,studentNumber,university;
            
            name= "zainab Sayed Hameed";
            studentNumber= "BH10500790";
            university= "AMA University";
    
            System.out.println("Name: "+name);
            System.out.println("Student Number: "+studentNumber);
            System.out.print("University: "+university);
        }
    }
    You tell us what your mistakes were.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    zaina is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    thx..

    my mistake i must writ
    name= "zainab Sayed Hameed";
    studentNumber= "BH10500790";
    university= "AMA University"; ( But i didn't )

    Also
    System.out.println("Name: "+name);
    System.out.println("Student Number: "+studentNumber);
    System.out.print("University: "+university); ( i didn't put + )

  6. #6
    zaina is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    and i didn't put ; :)

  7. #7
    zaina is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    see the next one
    is it true now ?
    Q3 :
    public class ZAINAB {

    public static void main(String[] args) {

    system.out.println("Account Name: "+Saving);
    system.out.println("Name: "+Zainab);
    system.out.print("Blance: "+2500);
    }
    }

Similar Threads

  1. sphinx-4 with JCreator
    By nassir in forum JCreator
    Replies: 0
    Last Post: 03-04-2010, 06:29 AM
  2. Ide(Jcreator) and jdk
    By dangr in forum New To Java
    Replies: 0
    Last Post: 01-12-2010, 08:02 AM
  3. jcreator
    By arshesander in forum New To Java
    Replies: 1
    Last Post: 08-03-2009, 11:31 AM
  4. About using jcreator
    By yuchuang in forum JCreator
    Replies: 4
    Last Post: 11-29-2008, 08:29 PM
  5. jcreator
    By nikhil_solanki015 in forum JCreator
    Replies: 2
    Last Post: 10-28-2008, 07:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •