Is the replace method of class string an accessor method

Assignment Help Programming Languages
Reference no: EM132128744

Assignment

Question One

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

A. 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);
}
}

B. public class HelloJava
{
public static void main(String args[])
{
int x=10;
int y=0;
System.out.print(x/y);
}

Question Two

A. Write a program that reads the following string "Hello, This is IT401 assignment 1" and does the following:

1. Use the replace method of the class String and replace IT401 with Business computer language.

2. Print the number of characters in the string after the replacement.

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

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()); }}

Question Four

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

1. Box1.translate(5,10);

2. momSavings.getBalance();

Question Five

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

378_Equation.jpg

Reference no: EM132128744

Questions Cloud

Procurement in the project management process : Analyze the importance of procurement in the project management process.
What would you recommend as a remedy to the drawback : Suppose a large office building has ESS WLAN for the office users. As a network engineer, you are asked to identify the drawbacks of the ESS WLAN.
Discuss the value of social data for marketers : Discuss the value of social data for marketers.
How the case study organization will collect data : Using the major business performance management (BPM) processes, describe the general process of how the case study organization will collect data.
Is the replace method of class string an accessor method : Use the replace method of the class String and replace IT401 with Business computer language.
Which is unique to german corporate governance : Analyze some of the issues affecting the current CEO John Cryan's future and note the role of supervisory board which is unique to German corporate governance
Discuss the techniques used by malware developers : Please discuss the techniques used by malware developers to disguise their code and prevent it from being analysed.
Think about negotiation or conflict situation : Think about a negotiation or conflict situation that you must soon address.
Provide wide range of interesting and well-paying jobs : IS departments provide a wide range of interesting and well-paying jobs, including many that do not require a detailed knowledge of programming

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd