Questions
Create a calculator in java without using the math library which converts an integer into a...

Create a calculator in java without using the math library which converts an integer into a hexadecimal number.

In: Computer Science

How are the results from a stereological measurement affected by the image magnification? How do you...

How are the results from a stereological measurement affected by the image magnification? How do you choose appropriate magnification for such a measurement?

In: Computer Science

CSCI 1302 Lab # 4 Multidimensional Arrays Write in Java Language!! Programming Exercise 8.5 (Algebra: add/subtract...

CSCI 1302 Lab # 4 Multidimensional Arrays

Write in Java Language!!

Programming Exercise 8.5 (Algebra: add/subtract two matrices)

Write a method to add/subtract two matrices. The header of the method is as follows:

public static double[][] addMatrix(double[][] a, double[][] b

or

public static double[][] subtractMatrix(double[][] a, double[][] b

In order to be add/subtract, the two matrices must have the same dimensions and the same or compatible types of elements. Let c be the resulting matrix. Each element cij is aij + bij. For example, for two 3 * 3 matrices a and b, c is

Write a test program that prompts the user to enter two 3 * 3 matrices and displays their sum or differece.

Programming Exercise 8.6 (Algebra: multiply two matrices)

Write a method to multiply two matrices. The header of the method is:

public static double[][] multiplyMatrix(double[][] a, double[][] b)

To multiply matrix a by matrix b, the number of columns in a must be the same as the number of rows in b, and the two matrices must have elements of the same or compatible types. Let c be the result of the multiplication. Assume the column size of matrix a is n. Each element cij is ai1 * b1j + ai2 * b2j + c + ain * bnj. For example, for two 3 * 3 matrices a and b, c is

where cij = ai1 * b1j + ai2 * b2j + ai3 * b3j. Write a test program that prompts the user to enter two 3 * 3 matrices and displays their product.

In: Computer Science

How to Create an 8- to 12-slide Microsoft® PowerPoint® presentation that summarizes the Agile Manifesto.

How to Create an 8- to 12-slide Microsoft® PowerPoint® presentation that summarizes the Agile Manifesto.

In: Computer Science

Compare and contrast between the implementation of the security pillars on the IT cloud computing environment...

Compare and contrast between the implementation of the security pillars on the IT cloud computing environment Vs. the IT data center environment?

In: Computer Science

how do you write a bubble sort function in python that sorts a linked list and...

how do you write a bubble sort function in python that sorts a linked list and if any duplicate are placed bext ti each other?

In: Computer Science

Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.....

Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.. >>> =RESTART: C:/Users/gamada/AppData/Local/Programs/python/python36/week/py= what is your name? gamada Enter a number (1-7) for the day of the week: 3 you selected 3 which is wednesday

In: Computer Science

Your manager asked you to generate a Fibonacci sequence to be used in a data analysis...

Your manager asked you to generate a Fibonacci sequence to be used in a data analysis project. The Fibonacci sequence is a series of numbers in which the next number is found by adding up the two numbers before it (e.g., 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...).

Write a C++ program to generate a Fibonacci sequence of the first 20 numbers.

In: Computer Science

Write a code that takes the initial velocity and angle as an input and outputs the...

Write a code that takes the initial velocity and angle as an input and outputs the maximum height of the projectile and its air time.

Follow the pseudo code below. This will not be provided in as much detail in the future so you’ll have to provide pseudocode or a flowchart to showcase your logic. For this first assignment though, the logic is laid out below with some indented more detailed instructions.

PROGRAM Trajectory:
Establish the User Interface (Typically referred to as the UI);

INPUT INPUT

Solve
Solve
Print

Start with an explanation of activity

Ask the user for the initial velocity;

Ask the user for the initial angle;

Include descriptive requests for inputs so the user knows what information is required.

for the maximum height the ball reaches;

for the length of time the ball is in the air;

the answers for the user;

Include a description with that return so the user understands what the data is

Plot height versus time; Plot height versus distance;

Do not overwrite your previous figure! This is a new plot but you still want the old one.

Make it clear what the plots are. Label the plot axes with units, include a title, and use a marker for the plot points.

END

In: Computer Science

true or false C++ a.    (T or F)   A function or method cannot return a value of type...

true or false C++

a.    (T or F)   A function or method cannot return a value of type array.

b.    (T or F)   C++ throws an exception if you try to refer to element 47 in an array with 20 elements.

c.    (T or F)   I can copy one array to another by simply using an assignment statement which assigns the one array to the other.

d.    (T or F)  An exception is the occurrence of an erroneous or unexpected situation during the execution of a program.

e.    (T or F)  The try / catch structure is used to test for and catch occurrences of syntax errors.

In: Computer Science

In C Program The first 11 prime integers are 2, 3, 5, 7, 11, 13, 17,...

In C Program

The first 11 prime integers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31.

A positive integer between 1 and 1000 (inclusive), other than the first 11 prime integers, is prime if it is not divisible by 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31.

Write a program that prompts the user to enter a positive integer between 1 and 1000 (inclusive) and that outputs whether the number is prime.

If the number is not prime, then output all the numbers, from the list of the first 11 prime integers, which divide the number.

Example (Numbers with underscore indicate an input):

Enter an integer between 1 and 1000 (inclusive): 62
62 is divisible by 2, 31.
62 is not prime.

--------------------------------------------

Enter an integer between 1 and 1000 (inclusive): -1
You must enter a number between 1 and 1000 (inclusive).

--------------------------------------------

Enter an integer between 1 and 1000 (inclusive): 1206
You must enter a number between 1 and 1000 (inclusive).

In: Computer Science

java Goal: This lab will give you practice writing code that uses inheritance and Java interfaces....

java

Goal: This lab will give you practice writing code that uses inheritance and
Java interfaces.
Please make sure you have a partner for this lab.
No code is provided with this lab. Write code to experimentally resolve the
following questions about Java. You will need to show your code to the TA or
lab assistant.
Part I: Assignments and Casting (1 point)
------------------------------------------
Let Y be a subclass of X, and let y and x be variables of classes Y and X
respectively. From lecture, you know that the assignment "x = y" is valid, but
the assignment "y = (Y) x" requires a cast to compile, and will cause a
run-time error if x references an object that isn’t a Y.
What about arrays of objects? Suppose xa is an array of X’s, and ya is an
array of Y’s.
(a) At compile-time, can we assign xa to ya, and vice versa? When is a cast
required?
(b) At run-time, if ya references an array of Y’s, can we assign it to xa?
Can we then assign it back from xa to ya?
(c) If xa references an array of X’s (that are not Y’s), can we assign it to
ya? Can we then assign it back from ya to xa? Does it make a difference
if the array of type X[] references objects that are all of class Y? Why
do you think this is the case?
Part II: Conflicting Declarations (1 point)
--------------------------------------------
Suppose a subclass inherits a method implementation from a superclass, and
implements a Java interface (that’s the "interface" keyword) that contains
a method with the same name and prototype.
(a) Will Java compile the result?
(b) What if the method declaration in the interface has a different return
type?
(c) What if the method declaration in the interface has the same return type,
but a signature with a different parameter type?
(d) What if the method declaration in the interface has the same return type,
and the same number of parameters and parameter types, but those
parameters have different names?
Part III: More Conflicting Declarations (1 point)
--------------------------------------------------
Suppose a subclass inherits a "public static final" constant from a superclass,
and implements a Java interface that contains a "public static final" constant
with the same name.
(a) Will Java compile the result? Does it make any difference whether the
constant in the superclass and the constant in the interface have the
same value?
(b) Write a main() method in the subclass that accesses the constant using the
same name used in the superclass and the Java interface. Will Java
compile the result? Does it make any difference whether the constant in
the superclass and the constant in the interface have the same value?
(c) Figure out how to modify your main() method so that it accesses and prints
one of the two conflicting values. (Look to the Lecture 9 notes for
clues.) Make sure your code compiles and runs without errors.
Part IV: Method Overriding (1 point)
-------------------------------------
Consider a subclass that has a method that overrides a method with the same
prototype in its superclass.
(a) Define a variable whose static type is the subclass and which references
an object of the subclass. If we cast the variable to the superclass type
before calling the overridden method
((Superclass) subclassvariable).method();
does Java call the superclass method or the subclass method?
(b) Define a variable whose static type is the superclass and which references
an object of the superclass (but not the subclass). If we cast the
variable to the subclass type before calling the method, does Java call
the superclass method or the subclass method?
(c) Suppose you have an object whose class is the subclass. Can you figure
out a way to call the superclass method on that object without having to
go through the subclass method of the same name?
Check-off
---------
Show your TA or Lab Assistant your code and, in some cases, its output.
1 point: Give your answers for Part I. Show the code with which you answered
Part I (c).
1 point: Give your answers for Part II.
1 point: Give your answers for Part III. Show _and_run_ the code with which
you answered Part III (c).
1 point: Give your answers for Part IV. Show the code with which you
answered Part IV (c).
Because this lab is on the long side, students who complete the first three
parts but don’t have time to complete the fourth part will get 4 points if they
promise to figure out the last part later.

In: Computer Science

Problem 2: There are no data errors that need to be checked as all the data...

  • Problem 2:

  • There are no data errors that need to be checked as all the data will be assumed correct.

  • You can use the array of the previous example to test your program, however, I

suggest that you also use other input arrays to validate the correctness and efficiency of your solution.

• Your program MUST be submitted only in source code form (.java file).

Write a program in Java to implement a recursive search functionint terSearch(int A[], int l, int r, int x)

that returns the location of x in a given sorted array of n integers A if x is present, otherwise -1.

The terSearch search function, unlike the binary search, must consider two dividing points

int d1 = l + (r - l)/3

int d2 = d1 + (r - l)/3

For the first call of your recursive search function terSearch you must consider l = 0 and r = A.length - 1.

Important Notes:

• For this problem you must add the main method in your program in order to test your implementation.

  • There are no data errors that need to be checked as all the data will be assumed correct.

  • Your program MUST be submitted only in source code form (.java file).

• A program that does not compile or does not run loses all correctness points.

In: Computer Science

2. Implement a drawing card game:using python 2.1 Build a class Card() that contains 2 variables:...

2. Implement a drawing card game:using python
2.1 Build a class Card() that contains 2 variables: rank and suits (10 points)

2.2 Build a Deck that contains 52 cards with ranks and suits. (20 points)
2.3 Two players will take turn to draw two cards from a shuffle decks. (30 points)
 You must implement a function call playerTurn(deck) to handle a player turn.
 playerTurn(deck) should include these features:


2.3.1 Draw 2 cards from the Deck created in 2.2
 2.3.2 Display ranks and suits of these cards


2.3.3 Return the sum of ranks of these cards. Notice that: ‘J’ = 11, ‘Q’ = 12, ‘K’ = 13, and ‘A’ = 1

2.4 The sum results will be compared between 2 players and who gets the larger in total will win that round. Notice that the game needs to keep track total number of player’s win round. (10 points)

2.5 Players have option to repeat as many times as they want. If the users choose ‘Y’, they will continue to draw from the original deck. (The deck will not be shuffled or added during the whole game. In other word, a card cannot be drawn twice during a game). (10 points)

In: Computer Science

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity...

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity bit is to be apppended at the left.

In: Computer Science