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

  Calculate the celsius equivalent of a fahrenheit temperature

Prepare a program to calculate the Celsius equivalent of a Fahrenheit temperature

  Dealerships are awarded the rebate

Dealerships are awarded the rebate on a quarter-by-quarter basis, only for quarters where their actual sales exceeded expected volumes for that quarter. Expected sales volumes for each quarter are as follows:

  Write a c program that will calculate the gross pay

Write a C program that will calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

  Declare a vector

Declare a vector of these structures where the size of the vector is to be 7.

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Prepare a simple game of blackjack using object oriented

prepare a simple game of blackjack using object oriented programming.uml class diagramsyour project must implement the

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

  Design a simple atm service kiosk

Design a simple ATM service kiosk. This kiosk supports the following options for its menu: 1. Viewing your account balance2. Depositing cash3. Withdrawing cash

  Write a while loop that lets the user enter a number

Write a while loop that lets the user enter a number-The number should be multiplied by 10, and the result stored in the variable product

  Program to declare array alpha of components of type int

Write C++ statements to do the following: Declare an array alpha of 15 components of the type int. Output the value of the tenth component of the array alpha.

  Definitions of the class circularlinkedlist

Write the definitions of the class circularLinkedList and its member functions. (You may assume that the elements of the circular linked list are in ascending order.)

  Program to report on the roots of a quadratic equation

Write a complete C++ program to report on the roots of a quadratic equation ax2 + bx + c = 0, a ≠ 0. compute the roots.

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