Business Computer Language IT401

Submit your assignment








 


Annual Report

FY [Year]

[Add a quote here from one of your company executives or use this space for a brief summary of the document content.]

 

Business Computer Language

IT401

 

 

     
Name: ###

 

CRN: ###

  ID: ###

 

     

 

 

1 Mark

Learning Outcome(s):

Use programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays in order to create a program based on specification.

 

 

 

 

 

 

Question One

Giving the following code snippet. What kind of errors you will get and how can you correct it.

  1. public class HelloJava
    {

public static void main(String args[])

{

int x=10;

int y=2;

System.out.print(x*y=”);

System.out.printl(x*y);

}

}

 

 

 

 

 

  1. public class HelloJava
    {

public static void main(String args[])
{

int x=10;

int y=0;

System.out.print(x/y);

}

1.5 Marks

Learning Outcome(s):

Use programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays in order to create a program based on specification.

 

 

 

 

 

Question Two

  1. Write a program that reads the following string “Hello, This is IT401 assignment 1” and does the following:
  2. Use the replace method of the class String and replace IT401 with Business computer language.
  3. Print the number of characters in the string after the replacement.

 

 

 

 

 

 

 

  1. Is the replace method of class String an accessor method or a mutator method. Explain your answer.

 

 

 

 

0.5 Mark
Learning Outcome(s):

Use programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays in order to create a program based on specification.

 

 

 

 

 

Question Three

Given the following class create 2 instances of the class and initialize them with  the values “Business computer language” and “IT401” respectively.

public class GradeBook {

    private String courseName;

    public GradeBook ()  {

        courseName =””;   }

    public GradeBook (String name) {

        courseName = name;    }

    public String getCourseName() {

        return courseName;   }

    public void displayMessage()  {

        System.out.println(“welcome, this is” + getCourseName()); }}

 

 

 

 

0.5 Marks
Learning Outcome(s):

Use programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays in order to create a program based on specification.

 

 

 

 

 

Question Four

What are the implicit and explicit parameters for the following methods:

  1. translate(5,10);

 

 

 

 

 

  1. getBalance();

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.5 Marks
Learning Outcome(s):

Use programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays in order to create a program based on specification.

 

 

 

 

 

Question Five

Write the following formula in java expression. Show all the required steps.

 

 

 

 

 

 

 

 

Click here to order this assignment @Essaywriting.us.No Plagiarism.Written from scratch by professional writers.

Leave a Reply

Your email address will not be published. Required fields are marked *