Largest element in the array.

 

 

1. (20 pts)
a) Write a method (function) that is passed an array of int and returns the largest element in the array.

 

b) Write a method (function) that is passed an array of int and returns the smallest element in the array.

 

 

 

 

 

c) Write a method (function) that is passed an array of int and returns the average of the elements in the array.

 

 

 

 

CISC 3115 Midterm Exam

2.(10 pts.)Given the GeometricObjectandTriangle classes below:

public class GeometricObject {
private String color = “white”;
private boolean filled;
private java.util.DatedateCreated;

/** Construct a default geometric object */
public GeometricObject() {
dateCreated = new java.util.Date();
}
. . .
}
public class Triangle extends GeometricObject
And the following declarations.
Triangle tri1 = new Triangle();
GeometricObject go1 = new GeometricObject();

circle all the Boolean expressions that are true below.

i)(tri1 instanceof GeometricObject)

ii)(go1 instanceof GeometricObject)

iii)(tri1 instanceof Triangle)

iv)(go1 instanceof Triangle)

b) Given the declaration of tri1 above, can the following statement be compiled? Why or why not?

GeometricObject go2 = tri1;

 

 

 

 

 

CISC 3115 Midterm Exam

3.(10 pts.)Given the following class declarations

public class myclass1 {
public double dvar1;
protected double dvar2;
public double dvar3;
private double dvar4;

protected void m1() {…}
private void m2(){…}
public void m3() {…}

Sample Solution

elp the administrative ball to roll. People should not wait till they find a perfect name, because the name of the company can also be changed later.

Getting the Employer Identification Number (EIN)

EIN is actually a federal tax number, which can be used for the identification of the business. EIN is actually needed when the business involves hiring employees or when the business is not owned by a sole proprietor but by two or three partners. As the Wonderf Waffle Co. is owned by two people, IN is necessary for this organization.

Registration of the trade name

Registering the trade name for the operation of the business is very necessary. If also it is not registered under the owner’s name, it should be named under the locality or the spot. There are many other legal procedures which need to be followed before starting the business, which include getting a license for the business and getting a bank account for the business.

STP Analysis

Wonder Waffle Co. is mainly trying to focus on meeting the demand of the regular local customers as well as serving the tourists of the area.

Market Segmentation

The main focus point of the Wonder Waffle Co. is both the middle and upper income group of people, because these segments of people consume the waffles. Attracting the local residents will help in the establishment of a large customer base and will help to establish a healthy and constant base of revenue, which will provide stability in the business. Tourists mainly contribute 35% of the income of the company and to attract the tourists, the company needs to have high visibility and competitive products and services.

Targeting

The main target for the Wonder Waffle Co. is the regular local customers. Expedient and personal customer service at a competitive price is the main key to maintain the share of the local market. Its base of target market is the tourists, who can help to enhance their business.

Positioning

The company wants to place itself in the minds of the customers as an affordable place with good quality and tasty waffles. It is the place, where all the people can visit, starting from young aged to old age people.

Porter’s five forces model

Porter’s five forces model helps to identify different strategies that are required to set up a business in a certain area. These forces are mainly used to measure the competitive intensity, attractiveness and profitability of the business.

Competition in the industry

This question has been answered.

Get Answer
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
👋 Hi, Welcome to Compliant Papers.