Question One
Find the issues in the following Java code, then correct them.
public class Rectangular
{
private int length;
private int width;
public Rectangular(int length, int width)
{
this.length = length;
this.width = width;
}
public String area ()
{
return length * width;
}
}
public class RectangularTest
{
public static void main (String[] args)
{
Rectangular r1 = new Rectangular(3,5);
System.out.println(area());
}
}
Question Two
1- Create a Java class for Student with the following requirements:
Each student has two attributes: Name and ID.
Create two constructors. One constructor without parameters to initialize all the instance variables to default values, and another constructor to initialize all the attributes to specific values.
Add all setter and getter methods.
2- Create a tester class with the main method with the following requirements.
Create two objects from Student class. Create the first object using the default constructor and the second object must set your name and ID.
Print your name and ID using getter methods.
Sample of the output:
Question Three
Suppose you have the following 2 dimensions array:
int arr[][] = {
{ 10, 11, 12, 13, 14 },
{ 15, 16, 17, 18, 19 },
{ 20, 21, 22, 23, 24 },
{ 25, 26, 27, 28, 29 },
{ 30, 31, 32, 33, 34 }
};
With the the following rows and columns sizes:
static int rows= 5;
static int columns= 5;
Write a Java programs that uses takes arr[][] and reverse (mirror) all rows. For example, the first row should be as the following after you reverse it 14 13 12 11 10. A screenshot of your output should also be included in your answer and should display both the original array and the reversed array.
Sample output:
Question Four
What is the output of the following Java program?
public class Exam
{
static int studyingHours = 31;
private String course = “OOP”;
public void compute(int studyingHours)
{
Exam e = new Exam();
this.studyingHours = 24;
course = “Math”;
System.out.println(“Exam.studyingHours: ” + Exam.studyingHours);
System.out.println(“e.studyingHours: ” + e.studyingHours);
System.out.println(“e.course: ” + e.course);
System.out.println(“course: ” + course);
}
public static void main(String args[])
{
Exam e = new Exam();
e.compute(31);
}
}
Category: Assembly Language
Please make sure to code in Raspberry pi 4 and use theArmv7 assembly subroutine.
Please make sure to code in Raspberry pi 4 and use theArmv7 assembly subroutine.
Task: Write the ARMv7 assembly subroutine: dist.
(a) On Canvas is a file, driver09.c, that you will use as the C program that calls your
assembly subroutines. While you can modify this file any way that you wish, note that
I will use my own C program to call your subroutines with whatever test cases I choose.
Ultimately, your subroutines should conform to the function declarations and notes given
below.
(b) Don’t tie your logic to the particular data in driver09.c.
(c) You will put your subroutine in the file hw09.s (the filename should match this exactly,
including the case of the characters).
(d) Write the assembly subroutine corresponding to this C function declaration:
double dist(struct point *p1, struct point *p2);
// the x/y coordinates of two points are passed, with each point in
// its own structure
// returns Euclidean distance between the points
(e) The Euclidean distance between points (x1, y1) and (x2, y2) is √(x1 − x2)2 + (y1 − y2)2.
(f) The values in the structure are stored as floats. In your program, convert the coordi-
nates to 64-bit floating point before you begin calculating the Euclidean distance.
(g) Remember that if in your subroutines you choose to store information in registers other
than R0-R3 or S0-S15, then you must preserve their values before doing so and restore
the values before the subroutine ends.
Note the following:
1. We are using ARMv7 assembly and the GNU C compiler on the 32-bit Raspberry Pi.
2. Each submitted program should conform to the compilation process that we did in class. That
is, I should be able to do the following, assuming your subroutines file is called hw09.s:
gcc driver09.c hw09.s
3. If you submit code that I think was produced by a compiler, chatGPT, someone on Chegg,
etc., then you will not receive credit.
4. As a comment in your subroutine file, include your name.
5. To submit, create a directory with a name that matches your net ID (for example, abc1234)
in lowercas
Discussion Board Purpose • In this discussion board, you will post any two quest
Discussion Board
Purpose
• In this discussion board, you will post any two questions related to weeks 2, 3 and 4. You will also read and respond to other classmates’ questions. This is an excellent way for you to interact with your colleagues and to share your thoughts about some relevant questions.
• I have placed the files from which the two questions must be placed, as well as two questions for me to answer
I’ve attached the document with instructions and an example. Unfortunately, I do
I’ve attached the document with instructions and an example. Unfortunately, I do not have any starter code to work with and the example in the instruction file is the only example I have. It should be relatively straightforward though!
Please answer all questions as indicated. These questions are for an Introductio
Please answer all questions as indicated. These questions are for an Introduction to Computer Organization course and the language that is being used is C. I have attached the exam questions below so please take a look at them!
You must submit two separate copies (one Word file and one PDF file) using the A
You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
It is your responsibility to check and make sure that you have uploaded both the correct files.
Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets, convert text into image or languages other than English
or any kind of manipulation).
Email submission will not be accepted.
You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
You must use this template, failing which will result in zero mark.
You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
Late submission will result in ZERO mark.
The work should be your own, copying from students or other resources will result in ZERO mark.
Use Times New Roman font for all your answers.
Must not be identical or copied (plagiarism)
please find the attached Word document to complete the assignment. note: please
please find the attached Word document to complete the assignment.
note: please don’t use pseudo instructions.
READ THIS FIRST:IF YOU DO NOT KNOW HOW TO SOLVE THIS ASSIGNMENT AND HAVE NEVER W
READ THIS FIRST:IF YOU DO NOT KNOW HOW TO SOLVE THIS ASSIGNMENT AND HAVE NEVER WORKED ON REVERSE ENGINEERING AND ASSEMBLY LANG. BEFORE, DO NOT BOTHER BIDDING.
This is a reverse Engineering assignment using static and dynamic analysis IDA Pro and Ollydbg (free versions are available online) This assignment consists of five “challenges”. Each challenge expects you to enter a particular string on stdin [Standard input—your keyboard]. If you enter the right string, good things happen, and you move on to the next challenge. So, please be careful in your analysis. As you might expect, the challenges get progressively harder, which is reflected in the points allocated to each of the challenges.The Ideal solution should contain a thorough analysis and screenshots of the solution for each challenge.The Enter strings must work; otherwise, an error message will appear, such as it’s too late,” etc.Attached is the exe file to be analysed and the passcode to be extracted to solve the five challenges.
I want you to add one paddle that can go left and right to stop the ball from to
I want you to add one paddle that can go left and right to stop the ball from touching the ground. Also create a sound code every time the ball touch the paddle makes sound. Pleassseeee make sure you use mars program.
I want you to add one paddle that can go left and right to stop the ball from to
I want you to add one paddle that can go left and right to stop the ball from touching the ground. Also create a sound code every time the ball touch the paddle makes sound. Pleassseeee make sure you use mars program.