Write code that will create a two dimensional array

Assignment Help C/C++ Programming
Reference no: EM13782079

1. Simplify the following

a)A && trueb)A || true
c)A || false
d)A && false

2. Convert to ORs using DeMorgan's Theorem

A && !B

3. Convert to ANDs using DeMorgan's Theorem

!(A||B||!C)

4. Simplify a&&(!b) || a&&b where a and b are boolean types.

5. In a boolean situation, what would be the opposite of the following expressions? Assume p is an integer type. USE ANATOMICALLY CORRECT JAVA SYNTAX.

a)(p > 9)
b)(r == 0)
c)(q >= s)

Use the following code in problems 6-9. Assume the Car class has already been created public class Tester
{
public static void main(StringI1 args)
{
double all= new double110001;
a121 = 19;
Car myCar = new Car(30); //sets mpg to 30 int tz = 46;
String s = "Pontotoc";
mcthodl(tz, a, myCar, s);
System.out.println (tz);
System.out.println(a121);
System.out.println(myCarempg);
Systenhout.println(s);
public static void methodl(int p, double glI, Car theCar, String str)
{
p = 800;
= -17.002;
thcCar.mpg = 25; str = "Field Creek";
}

6. What is printed by System.oraprintIn(tz); ?
7. What is printed by System.outprintln(aPp; ?
8. What is printed by System.omprintln(myCarmpg); ?
9. What is printed by System.outprintln(s); ?
10. Suppose the signature of a method is as follows:

private int bitWalker(int1111 x)
In the bit Valker method how would you determine how many rows are in the x army?
System.out.println( );

11. Using the signature from problem 7, show how you would determine from within the hitWalker
method how many columns are in this array. You may assume the array is perfectly rectangular and is not "ragged".

Systemout.println( );

12. Write code that will create a two dimensional array representing the following matrix. Use a for the object name.

12-20
-3472
6031

13. Using the array a[][] In you created in problem 9, what would be printed by the following code?

System.outprintln(a[2][1]);

14. What would be the result of running the following code?
int a[][] = new int[5][6];
a[1][2]=27;
a[1][3]=-11;
System.out.println(a[2][1]);

15. What is the effect of making a class abstract?

16. What is the effect of making a method abstract? Write the signature of abstract method anon4 that receives a two dimensional matrix and returns a boolean.

17. What is the effect of making a method final?

18. Name two ways you can make a method "invisible" to an inheriting class below it.

19. I create three objects from Vehicle, Car, Hybrid (in that order of hierarchy) named v1, c1, and h1 (respectively). What do the following statements print?

a)Systentout.println(v1 instanceof Car);
b)Systeni.out.println(h1 instanceof Car);
c)System.out.println(h1 instanceofIlybrid);
d)System.out.println(cl instanceof Vehicle);

20. Referring to the above, I create a method with the signature public void driveMe(Car temp).

a) Which of the following statements would be legal?

b) Fix any statements that are not legal

a) driveMe(v1);

b) driveMe(c1);

c) driveMe(h1);

21-24. Using pseudocode (i.e. it doesn't have to be legal JAVA), create three classes EnglishMusicians, RockBand, RollingStones. RockBand inherits EnglishMusicians, RollingStones inherit Rockband. For each one, create three method signatures (void, no parameters) that meet the following requirements:

a) One of EnglishMusicians' methods MUST be visible the whole way down the inheritance chain

b) A RollingStones object can use all three of its methods, two of Rockband's methods but only one of EnglishMusicians' methods.

25. Created two classes

public class Electron

{

public void charge1()
{

System.out.println("Charge1");

}

private void charge2()

{

System.out.println("Charge2");

}

public void charge3()

{

System.out.println("Charge3"),

}

}

public dass Quark extends Electron

{
public void charge3()

{

System.out.println("Flavor1");

}

public void charge4()

{

System.out.println("Flavor2");

}

public void charges()

{

System.out.println("Flavor3");

}

}

}

Explain what happens when I execute the folloing in a separate Tester class.

Electron sparky = new Quark();

sparky.charge2();

sparky.charge3();

sparky.charge5();

Reference no: EM13782079

Questions Cloud

Hypothesis statement concerning : Attached is the data set for this study. The numbers in the "No Meds" column indicate the number of months free from addiction without medication. The numbers in the "Meds" column indicate the number of months free from addiction while taking me..
Position paper position paper write up description : Position Paper Position Paper Write up Description: The purpose of this critical thinking assignment is to examine both sides of a controversial issue, select a position, apply it to a multicultural context, and to apply the Park University General E..
What is difference between holder and holder in due course : What is the difference between a holder and a holder in due course? Define each and explain the differences.
Conflict of ensuring public safety : Find an article online (2007 or newer) regarding the conflict of ensuring public safety and providing a community environment to promote offender treatment
Write code that will create a two dimensional array : show how you would determine from within the hitWalker method how many columns are in this array. You may assume the array is perfectly rectangular and is not "ragged". Write code that will create a two dimensional array representing the following ma..
Creating a work breakdown structure : How would you go about analyzing an organizational structure in terms of creating a work breakdown structure? What are the major organizational characteristics that you would evaluate? Provide an example to support your response. You may use your CLC..
Quality of work life initiatives : Quality of Work/Life Initiatives.
An internet company''s bankruptcy issues : Which is the most effective way to organize a document describing the events that led to an Internet company's bankruptcy?
Find the closest value : There are three equally likely states of nature (High, Medium, and Low demand). If the Build a large factory option will post profits of $90,000, $30,000, and - $30,000, respectively, in the three states of nature, what is the EMV of the option? Find..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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