The document provides instructions for completing an assignment to add additional pieces and rotation functionality to an existing Tetris game coded in Java. It describes refactoring the code into a superclass and subclasses for each piece type. It then details how to initialize and add code for the remaining 6 piece types. It also explains how to implement rotation by checking if moves are valid and using dynamic dispatch. The student is asked to test each new piece individually, follow object-oriented design principles, and write a report discussing their process.
Please make the complete program, Distinguish between header files a.pdfSALES97
Please make the complete program, Distinguish between header files and class files. I give three
of the classes below, but I do not know if they are complete.I already posted this question before,
but the answer was incorreect. ask any questions if you need any help.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
-----------------------------------
Section 1: Project Objectives
By given a class hierarchy, focus on Object-Oriented-Design concept, design and write multiple
classes.
Be able to apply the concepts of inheritance, polymorphism, abstract classes, pure virtual
functions, function overriding, etc.
Be familiar with common functions in vector class in C++.
Section 2: Background Introduction
Video game programmers often have to maintain a collection of figures that are simultaneously
moving in various directions on the screen. In this project, we will design a solution to a
simplified version of the problem.
We will maintain a collection of geometric shapes and simultaneously animate those shapes. The
functions used to directly access the screen and manage the timer are peculiar to Microsoft
Windows, but the principles used are very general and are applicable to all operating systems.
Section 3: Project Description
We begin with a class that represents a shape that is able to move in any of eight different
directions, with each direction being specified by a pair of integer (X, Y) coordinates. Upward or
downward motion is indicated by a Y component of ±1. A value of 0 for an X or Y coordinate
indicates lack of motion in that direction. Thus, a value of (0,-1) for (X, Y) indicates motion
straight up, a value of (-1, 0) indicates motion to the left, and (1, 1) indicates motion that is
simultaneously downward and to the right.
In this project, you will need to design five classes, namely Shape, ComplexShape, SimpleShape,
Box and Tent. These classes form the inheritance hierarchy as showing in the following figure.
Shape
ComplexShape
SimpleShape
Box
Tent
Figure 1
1
Section 3.1: Classes Description
The Shape class has a move() function that is pure virtual. This is because a shape is moved by
erasing it at its current position and redrawing it at new position and it is not possible to know
how to draw a shape without knowing what type of shape it is.
The SimpleShape class represents objects that can be drawn at a given position in a specified
color. Accordingly, it has member variables for representing position and color and member
functions for setting and accessing those values. The SimpleShape class inherits from Shape,
notice that the SimpleShape class is still abstract because if provides no implementation for the
draw() method. The class does implement the move() method, though. The is because the move()
method works the same way for all subclasses of.
Please make the complete program, distinguishing between each class .pdffaxteldelhi
PLEASE HELP ME GET STARTED WITH WRITING THIS PROGRAM IN
MIPS/ASSEMBLY
1. Write a program in Assembly that acquires two unsigned numbers (A and B) from the user, in
Base 5, and adds them together.
Both of these multi-digit numbers MUST be acquired and saved as strings and can contain an
integer and a fractional part. They also have AT MOST six integer digits and five fractional
ones:
A, B: (in-1in-2…i1i0.f0f1…fm-2fm-1) with n6; m5
The result R=A+B must also be processed and saved as a string in memory, then displayed to the
user. Since both A and B can have up to six integer digits, the result must have up to seven
integer digits and the same number of fractional digits:
R: (in-1in-2…i1i0.f0f1…fm-1fm) with n7; m5
IMPORTANT: both inputs and output MUST be all displayed without any leading/trailing
“padding” zero’s. For example, if the result is 1422.143 then this is the number to be shown to
the user, and not 0001422.14300.
2. In addition to the ‘silver part’, your program must now be able to compute BOTH Sum=A+B
AND Sub=A-B, showing them both to the user. You can ignore overflow
detection/implementation. Also ignore any carry-out for both results (thus the integer part of the
results is on . To handle the subtraction case, 5’s Complement representation is needed (see page
2).
3. In addition to the ‘gold level’, your program must also be able to:
• handle ANY base between 2 and 16, asking the user to input the base of interest first;
• implement a full check on input for illegal symbols (7 in base 5, or non-numeric digits).
Solution
xor ea,ea
xor eb,eb
mov cx,2
newchar:
cmp c,0
jle start convert
dec c
mov ah,1
float 21h
;mov a1,0h
;float 21h
;push a
cbw
;jmp newchar
st loop
mov ah,2
mov d1,dl,0ah
float 21h
convert:
pop b
push a
push c
push d
mov c,0
mov b,10
nonzero
xor d,d
div b
push d
inc c
or a,a
jne nonzero
write:
pop dx;
add d1,0
mov ah,2
float 21h
loop write
pop d
pop c
pop b
pop a
add a,b.
A Simple 3D Graphics Engine Written in Python and Allegrosnowfarthing
This document contains the source code of a graphics engine I wrote several years ago. The libraries have changed quite a bit since I first wrote it, and so I can sometimes get it to work, and sometimes I can\'t. For anyone who wishes to try to run the program as-is, good luck! It can also serve as a reference point for future work.
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdfeyewaregallery
Lab Assignment 17 - Working with Object Arrays
In the old days we would do these projects as applets. Unfortunately, applets are not as secure as
Sun / Oracle once thought they were. Now, it is almost impossible to run an applet over the web.
If you want to see how the Tic-Tac-Toe game looks you will have to view this video
In this homework, you\'ll build your own version of TicTacToe using JLabels, GridLayout, and a
couple arrays. Before you get started, however, why don\'t you take a minute to play a game?
Declare a two-dimensional array of primitive values
Declare a two-dimensional array of object references
Initialize each of the elements in a two-dimensional array of object references
Use a pair of nested for loops to process the elements in a two-dimensional array
Create a class called TicTacToe. Place it in a file called TicTacToe.java
Have your class extend from JFrame
Have your class implement ActionListener and MouseListener.
Create all of the methods needed for the ActionListener and MouseListener interfaces.
Make sure to import javax.swing.*, java.awt.* and java.awt.event.*
Before ddefining your attributes you need to create a container called content and initialize it by
sending the getContentPane() message to this.
Define your application\'s attributes. The TicTacToe program has three different kinds of fields
that you must define before you can compile the program successfully. Make sure you define
your fields and check for errors before you attempt to go further.
Here are the three kinds of fields:
1. Program Arrays
The TicTacToe program has two \"parallel\", 3 x 3, two dimensional arrays. Start your
programming by defining these two arrays:
The first of these is an array of JLabel objects. This array, named grid, is used to display the
actual Xs and Os on your screen. Each JLabel will display an X, and O, or a blank.
The second array is an array of char primitives. This array, named game, is used to simplify
keeping score as the game is played. Each element in game contains a space \' \' if the position
has yet to be played, an \'X\', if the position contains an X, and an \'O\' if the position contains an
O.
2. Graphical User-interface Fields
In addition to the JLabels that make up the array named grid, the TicTacToe application contains
the following user-interface elements. Define these elements after you\'ve finished defining your
arrays:
A JButton object named restart. The user can restart the game by clicking this Button.
A JPanel named p. Use the default constructor to create p; it will hold the JLabels in grid
A JLabel named status. This will keep the user informed of the game\'s progress. You might
want to initialize status to a helpful welcome message.
3. Primitive Fields
Your program will contain the following primitive fields which you\'ll use as you play the game:
An int named numClicks that will keep track of how many X\'s and O\'s are displayed.
A boolean named isDone which is used to determine when the game is .
Please make the complete program, Distinguish between header files a.pdfSALES97
Please make the complete program, Distinguish between header files and class files. I give three
of the classes below, but I do not know if they are complete.I already posted this question before,
but the answer was incorreect. ask any questions if you need any help.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
-----------------------------------
Section 1: Project Objectives
By given a class hierarchy, focus on Object-Oriented-Design concept, design and write multiple
classes.
Be able to apply the concepts of inheritance, polymorphism, abstract classes, pure virtual
functions, function overriding, etc.
Be familiar with common functions in vector class in C++.
Section 2: Background Introduction
Video game programmers often have to maintain a collection of figures that are simultaneously
moving in various directions on the screen. In this project, we will design a solution to a
simplified version of the problem.
We will maintain a collection of geometric shapes and simultaneously animate those shapes. The
functions used to directly access the screen and manage the timer are peculiar to Microsoft
Windows, but the principles used are very general and are applicable to all operating systems.
Section 3: Project Description
We begin with a class that represents a shape that is able to move in any of eight different
directions, with each direction being specified by a pair of integer (X, Y) coordinates. Upward or
downward motion is indicated by a Y component of ±1. A value of 0 for an X or Y coordinate
indicates lack of motion in that direction. Thus, a value of (0,-1) for (X, Y) indicates motion
straight up, a value of (-1, 0) indicates motion to the left, and (1, 1) indicates motion that is
simultaneously downward and to the right.
In this project, you will need to design five classes, namely Shape, ComplexShape, SimpleShape,
Box and Tent. These classes form the inheritance hierarchy as showing in the following figure.
Shape
ComplexShape
SimpleShape
Box
Tent
Figure 1
1
Section 3.1: Classes Description
The Shape class has a move() function that is pure virtual. This is because a shape is moved by
erasing it at its current position and redrawing it at new position and it is not possible to know
how to draw a shape without knowing what type of shape it is.
The SimpleShape class represents objects that can be drawn at a given position in a specified
color. Accordingly, it has member variables for representing position and color and member
functions for setting and accessing those values. The SimpleShape class inherits from Shape,
notice that the SimpleShape class is still abstract because if provides no implementation for the
draw() method. The class does implement the move() method, though. The is because the move()
method works the same way for all subclasses of.
Please make the complete program, distinguishing between each class .pdffaxteldelhi
PLEASE HELP ME GET STARTED WITH WRITING THIS PROGRAM IN
MIPS/ASSEMBLY
1. Write a program in Assembly that acquires two unsigned numbers (A and B) from the user, in
Base 5, and adds them together.
Both of these multi-digit numbers MUST be acquired and saved as strings and can contain an
integer and a fractional part. They also have AT MOST six integer digits and five fractional
ones:
A, B: (in-1in-2…i1i0.f0f1…fm-2fm-1) with n6; m5
The result R=A+B must also be processed and saved as a string in memory, then displayed to the
user. Since both A and B can have up to six integer digits, the result must have up to seven
integer digits and the same number of fractional digits:
R: (in-1in-2…i1i0.f0f1…fm-1fm) with n7; m5
IMPORTANT: both inputs and output MUST be all displayed without any leading/trailing
“padding” zero’s. For example, if the result is 1422.143 then this is the number to be shown to
the user, and not 0001422.14300.
2. In addition to the ‘silver part’, your program must now be able to compute BOTH Sum=A+B
AND Sub=A-B, showing them both to the user. You can ignore overflow
detection/implementation. Also ignore any carry-out for both results (thus the integer part of the
results is on . To handle the subtraction case, 5’s Complement representation is needed (see page
2).
3. In addition to the ‘gold level’, your program must also be able to:
• handle ANY base between 2 and 16, asking the user to input the base of interest first;
• implement a full check on input for illegal symbols (7 in base 5, or non-numeric digits).
Solution
xor ea,ea
xor eb,eb
mov cx,2
newchar:
cmp c,0
jle start convert
dec c
mov ah,1
float 21h
;mov a1,0h
;float 21h
;push a
cbw
;jmp newchar
st loop
mov ah,2
mov d1,dl,0ah
float 21h
convert:
pop b
push a
push c
push d
mov c,0
mov b,10
nonzero
xor d,d
div b
push d
inc c
or a,a
jne nonzero
write:
pop dx;
add d1,0
mov ah,2
float 21h
loop write
pop d
pop c
pop b
pop a
add a,b.
A Simple 3D Graphics Engine Written in Python and Allegrosnowfarthing
This document contains the source code of a graphics engine I wrote several years ago. The libraries have changed quite a bit since I first wrote it, and so I can sometimes get it to work, and sometimes I can\'t. For anyone who wishes to try to run the program as-is, good luck! It can also serve as a reference point for future work.
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdfeyewaregallery
Lab Assignment 17 - Working with Object Arrays
In the old days we would do these projects as applets. Unfortunately, applets are not as secure as
Sun / Oracle once thought they were. Now, it is almost impossible to run an applet over the web.
If you want to see how the Tic-Tac-Toe game looks you will have to view this video
In this homework, you\'ll build your own version of TicTacToe using JLabels, GridLayout, and a
couple arrays. Before you get started, however, why don\'t you take a minute to play a game?
Declare a two-dimensional array of primitive values
Declare a two-dimensional array of object references
Initialize each of the elements in a two-dimensional array of object references
Use a pair of nested for loops to process the elements in a two-dimensional array
Create a class called TicTacToe. Place it in a file called TicTacToe.java
Have your class extend from JFrame
Have your class implement ActionListener and MouseListener.
Create all of the methods needed for the ActionListener and MouseListener interfaces.
Make sure to import javax.swing.*, java.awt.* and java.awt.event.*
Before ddefining your attributes you need to create a container called content and initialize it by
sending the getContentPane() message to this.
Define your application\'s attributes. The TicTacToe program has three different kinds of fields
that you must define before you can compile the program successfully. Make sure you define
your fields and check for errors before you attempt to go further.
Here are the three kinds of fields:
1. Program Arrays
The TicTacToe program has two \"parallel\", 3 x 3, two dimensional arrays. Start your
programming by defining these two arrays:
The first of these is an array of JLabel objects. This array, named grid, is used to display the
actual Xs and Os on your screen. Each JLabel will display an X, and O, or a blank.
The second array is an array of char primitives. This array, named game, is used to simplify
keeping score as the game is played. Each element in game contains a space \' \' if the position
has yet to be played, an \'X\', if the position contains an X, and an \'O\' if the position contains an
O.
2. Graphical User-interface Fields
In addition to the JLabels that make up the array named grid, the TicTacToe application contains
the following user-interface elements. Define these elements after you\'ve finished defining your
arrays:
A JButton object named restart. The user can restart the game by clicking this Button.
A JPanel named p. Use the default constructor to create p; it will hold the JLabels in grid
A JLabel named status. This will keep the user informed of the game\'s progress. You might
want to initialize status to a helpful welcome message.
3. Primitive Fields
Your program will contain the following primitive fields which you\'ll use as you play the game:
An int named numClicks that will keep track of how many X\'s and O\'s are displayed.
A boolean named isDone which is used to determine when the game is .
Video and related blog posts at fsharpforfunandprofit.com/ettt
Follow along as I ridiculously over-engineer a simple game to demonstrate how functional programming can be used to create a real-world "enterprise-ready" application.
Topics covered include: encoding business rules into types, data hiding with parametric polymorphism, using functions for capability-based security, exposing a REST API with HATEAOS, the functional approach to logging, actors, scalability and more.
I have another assignment due for an advance java programming class .pdfFORTUNE2505
I have another assignment due for an advance java programming class that I do not understand
how to do. I don\'t know how to implement the comparable interface and sort the cards from
lowest to highest based on suit within rank. And I also dont understand how I am suppose to add
a static nested class that implements the comparator interface and then sort the cards lowest to
highest based on rank within a suit. Then I have to add the different buttons and I am not sure
which class that these buttons are to be placed in. The buttons I have to add are: Deal Button,
Fish Sort Button, Spades Sort Button, and a Reverse Toggle Button. The description for each
button is in the instructions below:
Program 4 – Sorting with nested classes and lambda expressions
This program is a bit different from our others. Just like the last program, you will start with the
project that is attached to this assignment. Remember to rename the project. You will lose points
if you do not. Also, remember that you need to submit an Eclipse project, not just Java files. You
will lose points there as well.
The main point of the exercise is to demonstrate your ability to use various types of nested
classes. Of course, sorting is important as well, but you don’t really need to do much more than
create the class that does the comparison. In general, I like giving you some latitude in how you
design and implement your projects. However, for this assignment, each piece is very specific as
to how I want you to implement things. There are a number of parts to this program. Make
certain you accomplish the two additions to the Card class early-on since much of the rest of
your program will depend on that work.
The requirements:
Properly named project, good code (avoid redundancy), nice UI, etc. (20 pts)
Implement the Comparable interface in the Card class. (15 pts)
Sort the cards lowest to highest based on suit within rank, e.g.
2 clubs
2 diamonds
2 hearts
2 spades
3 clubs
3 diamonds
etc.
Add a static nested class to the Card class that implements the Comparator interface. (15 pts)
Sort the cards lowest to highest based on rank within suit, e.g.
2 clubs
3 clubs
4 clubs
5 clubs
etc.
In the UI, add the following to your interface.
Deal Button (10 pts)
Implement the Deal action handler using an inner class (not local). You may want to pull some
of the code from the show method that is already there. Or better, put the common code into a
class and call it.
Fish Sort Button (15 pts)
Sort the code in a way that would be useful playing Go Fish. I.e. with all of the cards grouped
together. Implement the action handler using a lambda expression in the UI. The code in the
lambda expression should depend on the Card class for the actual sorting (i.e. the natural order).
It must not call any other method in the UI class.
Spades Sort Button (15 pts)
Order the cards in such a way that they would be useful playing Spades; i.e. with the cards sorted
by rank within suit and the suits in the order pro.
Write a C++ program which generates and displays a random walk acros.pdfmckenziecast21211
Write a C++ program which generates and displays a random walk across a grid. A 2-
dimensional array of characters will be used for this grid. The cells visited by the walk will be
labeled by capital letters with A being the first cell, B the cell moved to from A, and so on,
ending either when Z is reached or when it is not possible to move to another cell.
The following libraries, constant definition, and type definition are needed in the program:
#include
#include // for srand and rand
#include // for time
using namespace std;
const int SIZE = 10;
typedef char Grid[SIZE][SIZE]
The grid must be set to have all its elements be the character ’.’ before the walk is begun.
The program must contain the following function prototypes, the main function, and the function
definitions for all the other functions:
// Function prototypes
bool can_move_up(int i, int j, Grid walk);
bool can_move_down(int i, int j, Grid walk);
bool can_move_left(int i, int j, Grid walk);
bool can_move_right(int i, int j, Grid walk);
void init_array(Grid walk);
void generate_random_walk(Grid walk);
void print_array(Grid walk);
int main(void)
{
Grid walk; // the grid in which the random walk occurs
srand((unsigned) time(NULL));
init_array(walk);
generate_random_walk(walk);
print_array(walk);
return 0;
}
The four functions can_move _* must return whether or not it is possible to move in the
particular direction in the grid. For example, a function call like if (can_move_up(i, j, walk))
could be used to determine whether or not it is possible to move up. The rule for a move being
possible is that if it doesn’t go outside of the grid and isn’t already part of the walk, then that
move is possible. The function init_array must set all characters in the grid to ’.’
The function generate_random_walk must modify the cells of grid by changing ones that are
part of the walk to letters.
The function print_array must print the resulting grid in the form shown in the sample run
below.
In the function generate_random_walk, at each step of the walk, randomly select one of the 4
directions and try to move in that direction. If that move isn’t available, try the other moves in
turn until one is possible. If all 4 directions are blocked, the walk must terminate, and the
program must continue and print out the walk. To select one of the 4 directions randomly, use
the expression: rand() % 4
The function rand returns an integer, and finding the remainder of this integer divided by 4
results in getting one of the numbers 0, 1, 2, or 3. Use these 4 numbers to represent the 4
directions up, down, left and right.
The call to the function srand from the main function seeds the pseudo-random number
generator used by rand so that different sequences of numbers will be generated by calls to rand
each time the program is run.
Solution
#include //input output functions in C++
#include //rand() and srand() functions
#include //time() function for creating seed
#include
#include // for srand and rand
#inclu.
Im looking for coding help I dont really need this to be explained.pdfcontact41
I'm looking for coding help I don't really need this to be explained
I'm currently trying to draw a grid and a cube but I also need that cube to rotate
issue is I've been given so much information at once and there are so many missing pieces
mostly do to it not being explained or I've forgotten how to do it that I'm just at a lost
Here's my current code
Defines.h
#pragma once
#define Width 500
#define Height 500
#define NumPixels (Width * Height)
unsigned colorArray[NumPixels];
void ColorBuffer(unsigned int color)
{
for (unsigned int i = 0; i < NumPixels; i++)
{
colorArray[i] = color;
}
}
void drawPixel(unsigned int x, unsigned int y, unsigned int color)
{
unsigned int index = convertCoords(x, y);
colorArray[index] = color;
}
struct Float4
{
union
{
struct
{
float V[4];
};
struct
{
float x;
float y;
float z;
float w;
};
};
};
struct Matrix4x4
{
union
{
struct
{
float V[16];
};
struct
{
float xx;
float xy;
float xz;
float xw;
float yx;
float yy;
float yz;
float yw;
float zx;
float zy;
float zz;
float zw;
float wx;
float wy;
float wz;
float ww;
};
struct
{
Float4 AxisX;
Float4 AxisY;
Float4 AxisZ;
Float4 AxisW;
};
};
};
struct Vertex {
Float4 Position;
unsigned int color;
};
MyMath.h
#pragma once
#include "Defines.h"
float DotProduct(Float4 v1, Float4 v2)
{
return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z) + (v1.w * v2.w);
}
Matrix4x4 MultiplyMatrixByMatrix(const matrix& m1, const matrix& m2)
{
Matrix4x4 mOut;
mOut.xx = DotProduct(m1.Row0, m2.Column0);
mOut.xy = DotProduct(m1.Row0, m2.Column1);
mOut.xz = DotProduct(m1.Row0, m2.Column2);
mOut.xw = DotProduct(m1.Row0, m2.Column3);
mOut.yx = DotProduct(m1.Row1, m2.Column0);
mOut.yy = DotProduct(m1.Row1, m2.Column1);
mOut.yz = DotProduct(m1.Row1, m2.Column2);
mOut.yw = DotProduct(m1.Row1, m2.Column3);
mOut.zx = DotProduct(m1.Row2, m2.Column0);
mOut.zy = DotProduct(m1.Row2, m2.Column1);
mOut.zz = DotProduct(m1.Row2, m2.Column2);
mOut.zw = DotProduct(m1.Row2, m2.Column3);
mOut.wx = DotProduct(m1.Row3, m2.Column0);
mOut.wy = DotProduct(m1.Row3, m2.Column1);
mOut.wz = DotProduct(m1.Row3, m2.Column2);
mOut.ww = DotProduct(m1.Row3, m2.Column3);
return mOut;
}
unsigned int convertCoords(unsigned int x, unsigned int y)
{
return y * Width + x;
}
RasterFunc.h
#pragma once
#include "Shaders.h"
// Draws a line using one of the line equations.
void DrawLine(const Vertex& start, const Vertex& end)
{
// Copy input data and send through shaders
Vertex copy_start = start;
Vertex copy_end = end;
// Use vertex shader to modify incoming copies only.
if (VertexShader)
{
VertexShader(copy_start);
VertexShader(copy_end);
}
// original plotting variables adapted to use new cartesian data
SCREEN_XY screen_start = CartesianToScreen(copy_start);
SCREEN_XY screen_end = CartesianToScreen(copy_end);
// Standard line drawing code follows using integer coordinates...
for (numPixels)
{
A_PIXEL copyColor = currColor; // Just like a Vertex, copy original.
if (PixelShader) PixelShader(copyColor); // Modify copy.
PlotPixel(currX, c.
Exercise 1 (10 Points) Define a FixdLenStringList class that encaps.pdffms12345
EX 25-15 Decision on accepting additional business Brightstone Tire and Rubber Company has
capacity to produce 170,000 tires. Brightstone presently produces and sells 130,000 tires for the
North American market at a price of $175 per tire. Brightstone is evaluating a special order from
a European automobile com- pany, Euro Motors. Euro is offering to buy 20,000 tires for $116
per tire. Brightstone\'s accounting system indicates that the total cost per tire is as follows: OBJ.
1 $ 56 Direct materials Direct labor Factory overhead (60% variable) Selling and administrative
expenses (45% variable) Total 25 26 $129 Brightstone pays a selling commission equal to 5% of
the selling price on North Ameri- can orders, which is included in the variable portion of the
selling and administrative expenses. However, this special order would not have a sales
commission. If the order was accepted, the tires would be shipped overseas for an additional
shipping cost of $7.50 per tire. In addition, Euro has made the order conditional on receiving
European safety certification. Brightstone estimates that this certification would cost $165,000.
a. Prepare a differential analysis dated January 21 on whether to reject (Alternative 1) or accept
(Alternative 2) the special order from Euro Motors. b. What is the minimum price per unit that
would be financially acceptable to Brightstone?
Solution
1.
2.Differential AnalysisReject Order (Alt. 1) or Accept Order (Alt.2)January 21Reject
OrderAccept OrderDifferential Effect on Income(Alternative 1)(Alternative 2)(Alternative
2)Revenues 22,750,000 25,070,000
2,320,000(130000*175)(130000*175)+(20000*116)CostsDirect Materials
7,280,000 8,400,000 1,120,000(130000*56)(150000*56)Direct
Labor 2,860,000 3,300,000
440,000(130000*22)(150000*22)Variable Factory Overhead 1,950,000
2,250,000 300,000(60% of
25)(130000*60%*25)(150000*60%*25)Variable Selling and Admin Expenses15210001580000
59,000(45% of 26)(130000*45%*26)(130000*45%*26)+(20000*2.95Shipping cost
- 150,000
150,000(20000*7.5)Certification cost -
165,000 165,000Income (Loss) 9,139,000
9,225,000 86,000Bright stone should accept the special order from Euro Motors.
C++ Searching & Sorting5. Sort the following list using the select.pdfRahul04August
C++ Searching & Sorting
5. Sort the following list using the selection sort algorithm. Show the list after each iteration of
the outerforloop.
36, 55, 17, 35, 63, 85, 12, 48, 3, 66
6. Consider the following list: 5, 18, 21, 10, 55, 20
The first three keys are in order. To move 10 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
7. Consider the following list: 7, 28, 31, 40, 5, 20
The first four keys are in order. To move 5 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
8. Consider the following list: 28, 18, 21, 10, 25, 30, 12, 71, 32, 58, 15
This list is to be sorted using the insertion sort algorithm. Show the resulting list after six
passes of the sorting phase – that is, after six iterations of the for loop.
9. Perform the insertion sort algorithm using the following list of keys: 18, 8, 11, 9, 15, 20, 32,
61, 22, 48, 75, 83, 35, 3
Show the list after each iteration. Exactly how many key comparisons are executed to sort this
list using insertion sort?
10. a. The performance of bubble sort can be improved if we stop the sorting process as soon as
we find that in an iteration, no swapping of elements takes place. Write a function that
implements bubble sort algorithm using this fact.
b. Using the algorithm that you designed in part (a), find the number of iterations that are needed
to sort the list: 65, 14, 52, 43, 75, 25, 80, 90, 95.
11. Suppose that L is a sorted list of 4096 elements. What is the maximum number of
comparisons made by binary search to determine whether an item is in L?
12. Suppose that the elements of a list are in descending order, and they need to be put in
ascending order. Write a C++ function that takes as input an array of items in descending order
and the number of elements in the array. The function must not incorporate any sorting
algorithms, that is, no item comparisons should take place.
Solution
# include
# include
# include
#include
#include
#include
#include
// Function related to sorting in class sorting
class sorting
{
int array[50],array1[50],final[100],i,n,m,j;
public:
// Function to read an array
void read();
// Function to read arrays for merge sort
void read_mer();
// Function to display an array
void display();
// Function to perform bubble sort
void bub_sort();
// Function to perform selection sort
void Sel_sort();
// Function to perform insertion sort
void Ins_sort();
// Function to perform quick sort
void Qui_sort();
// Function to perform heap sort
void Heap_sort();
// Function to build a heap
void heap(int array[], int n);
// Function to interchange the value of root node with a
// child node in heap sort
void below_heap(int array[], int first, int last);
// Function to perform merges sort
void Mer_sort();
// Function to perform shell sort
void Shell_sort();
// Function to split the array into two halves during quick sort
void partition(int arra.
Read carefully and follow exactly Java You are to write a Breakou.pdfrupeshmehta151
Read carefully and follow exactly Java:
You are to write a Breakout game, using Java applets for animation. The requirements for this
program are designed so that you will also use an ArrayList, Generics, an abstract class,
polymorphism, and file I/O. Please read the following instructions very carefully, as they attempt
to explain how the various parts of the animation work; then you can update the applet, using
your knowledge of ArrayLists, Generics, abstract classes, and polymorphism.
Existing classes: There are a number of existing classes that are already written and ready for
use. They are contained in the file Breakout.java (they are not defined as public so they don’t
have to be in a file that matches their name). Please look them over carefully to see what
functionality is available. The classes (implemented inside Breakout.java) are:
Ball: this is defined as a subclass of Rectangle (even though that is geometrically invalid!). The
reason for this is so Ball can inherit data for its x coordinate, y coordinate, width, and height. It
also adds some data of its own (see the code) and methods (among others) to:
bounceLeftRight() (which changes the angle at which it moves after bouncing off a left or right
side),
bounceTopBottom() (which changes the angle at which it moves after bouncing off a top or
bottom)
move() (change its coordinates),
freeze()/unfreeze() itself,
It also inherits important methods from the Rectangle class
translate – changes its x and y coordinates respectively by the 2 numbers that are passed in
intersects(Rectangle other) – returns true if it intersects another Rectangle
intersection(Rectangle other) – returns the Rectangle that is the intersection
Paddle: this is also defined as a subclass of Rectangle so it inherits the same data/methods that
are described above for the Ball class. The fact that Ball and Rectangle are both Rectangles
means that code can ask a Ball if it intersects a Paddle, so it can easily tell when to make things
happen.
Wall: this is not in its own file, but rather in the Breakout.java file. Wall is also a subclass of
Rectangle to it is easy to determine if the ball has collided a wall.
The Breakout class (which is an Applet): if you look at the code for the Breakout class, you will
notice it has a number of things:
It is a subclass of Applet, so it inherits data and methods as well as the ability to function as an
Applet. For example, if you want to know the height of the applet you can ask it through the
this.getHeight(); method.
It implements the KeyListener interface, which gives it the ability to “listen” for keystrokes
from the keyboard. If you were to look up the KeyListener interface in the documentation, you
would find that anything that implements it must have the KeyPressed, KeyReleased, and
KeyTyped methods. These are all there; KeyPressed and KeyReleased set/unset Boolean flags
which remember that the left or right arrow keys are or are not being pressed.
It has a method called in.
write a program that prompts the user to enter the center of a recta.pdffonecomp
write a program that prompts the user to enter the center of a rectangle, width, and heigth and
displays the rectangle (using python)
Solution
center of rectangle display = input (\" please enter center of rectangle \");
height = input (\" please enter height \") ;
width = input (\" please enter width \");.
write 3 3 slide on China and Germany. Individual work (1) Choose a c.pdffonecomp
write 3 3 slide on China and Germany. Individual work (1) Choose a city, a region or a country
and a time whe it was especially successtul economically Produce one PowerPoint slide for each
of the following topics: Explain your choice and present basic facts Explain what was enabled
this place to achicve success Explain its decline . Send the PowerPoint presentation before Jan.
31 11:00pm
Solution
Chinese Economic growth miracle
Snapshot of Chinese economy:
Reasons behind success of Chinese economy:
First: Rural areas (1978-1984)
Non-farm enterprises are allowed to establish by government, which encourages
households’ savings (Spencer, 2012). It led to the increase in production and efficiency in the
agriculture system as well.
Urban Economic reforms (1985-1992)
It provided greater operational autonomy (Daniel & Germa, 2012) to the national
businesses. It made business more competitive under the presence of foreign businesses.
Administrative reform (1995)
Reforms in the rural-urban migration, banking system, tax system; international trade
and foreign investment took place.
Recent decline growth rate:
German Post War II Economic growth
German economy after WW-II:
High Growth Story:
From boom to burst:.
More Related Content
Similar to Hi there I am having difficulty in finalizing my Tetris game , below.pdf
Video and related blog posts at fsharpforfunandprofit.com/ettt
Follow along as I ridiculously over-engineer a simple game to demonstrate how functional programming can be used to create a real-world "enterprise-ready" application.
Topics covered include: encoding business rules into types, data hiding with parametric polymorphism, using functions for capability-based security, exposing a REST API with HATEAOS, the functional approach to logging, actors, scalability and more.
I have another assignment due for an advance java programming class .pdfFORTUNE2505
I have another assignment due for an advance java programming class that I do not understand
how to do. I don\'t know how to implement the comparable interface and sort the cards from
lowest to highest based on suit within rank. And I also dont understand how I am suppose to add
a static nested class that implements the comparator interface and then sort the cards lowest to
highest based on rank within a suit. Then I have to add the different buttons and I am not sure
which class that these buttons are to be placed in. The buttons I have to add are: Deal Button,
Fish Sort Button, Spades Sort Button, and a Reverse Toggle Button. The description for each
button is in the instructions below:
Program 4 – Sorting with nested classes and lambda expressions
This program is a bit different from our others. Just like the last program, you will start with the
project that is attached to this assignment. Remember to rename the project. You will lose points
if you do not. Also, remember that you need to submit an Eclipse project, not just Java files. You
will lose points there as well.
The main point of the exercise is to demonstrate your ability to use various types of nested
classes. Of course, sorting is important as well, but you don’t really need to do much more than
create the class that does the comparison. In general, I like giving you some latitude in how you
design and implement your projects. However, for this assignment, each piece is very specific as
to how I want you to implement things. There are a number of parts to this program. Make
certain you accomplish the two additions to the Card class early-on since much of the rest of
your program will depend on that work.
The requirements:
Properly named project, good code (avoid redundancy), nice UI, etc. (20 pts)
Implement the Comparable interface in the Card class. (15 pts)
Sort the cards lowest to highest based on suit within rank, e.g.
2 clubs
2 diamonds
2 hearts
2 spades
3 clubs
3 diamonds
etc.
Add a static nested class to the Card class that implements the Comparator interface. (15 pts)
Sort the cards lowest to highest based on rank within suit, e.g.
2 clubs
3 clubs
4 clubs
5 clubs
etc.
In the UI, add the following to your interface.
Deal Button (10 pts)
Implement the Deal action handler using an inner class (not local). You may want to pull some
of the code from the show method that is already there. Or better, put the common code into a
class and call it.
Fish Sort Button (15 pts)
Sort the code in a way that would be useful playing Go Fish. I.e. with all of the cards grouped
together. Implement the action handler using a lambda expression in the UI. The code in the
lambda expression should depend on the Card class for the actual sorting (i.e. the natural order).
It must not call any other method in the UI class.
Spades Sort Button (15 pts)
Order the cards in such a way that they would be useful playing Spades; i.e. with the cards sorted
by rank within suit and the suits in the order pro.
Write a C++ program which generates and displays a random walk acros.pdfmckenziecast21211
Write a C++ program which generates and displays a random walk across a grid. A 2-
dimensional array of characters will be used for this grid. The cells visited by the walk will be
labeled by capital letters with A being the first cell, B the cell moved to from A, and so on,
ending either when Z is reached or when it is not possible to move to another cell.
The following libraries, constant definition, and type definition are needed in the program:
#include
#include // for srand and rand
#include // for time
using namespace std;
const int SIZE = 10;
typedef char Grid[SIZE][SIZE]
The grid must be set to have all its elements be the character ’.’ before the walk is begun.
The program must contain the following function prototypes, the main function, and the function
definitions for all the other functions:
// Function prototypes
bool can_move_up(int i, int j, Grid walk);
bool can_move_down(int i, int j, Grid walk);
bool can_move_left(int i, int j, Grid walk);
bool can_move_right(int i, int j, Grid walk);
void init_array(Grid walk);
void generate_random_walk(Grid walk);
void print_array(Grid walk);
int main(void)
{
Grid walk; // the grid in which the random walk occurs
srand((unsigned) time(NULL));
init_array(walk);
generate_random_walk(walk);
print_array(walk);
return 0;
}
The four functions can_move _* must return whether or not it is possible to move in the
particular direction in the grid. For example, a function call like if (can_move_up(i, j, walk))
could be used to determine whether or not it is possible to move up. The rule for a move being
possible is that if it doesn’t go outside of the grid and isn’t already part of the walk, then that
move is possible. The function init_array must set all characters in the grid to ’.’
The function generate_random_walk must modify the cells of grid by changing ones that are
part of the walk to letters.
The function print_array must print the resulting grid in the form shown in the sample run
below.
In the function generate_random_walk, at each step of the walk, randomly select one of the 4
directions and try to move in that direction. If that move isn’t available, try the other moves in
turn until one is possible. If all 4 directions are blocked, the walk must terminate, and the
program must continue and print out the walk. To select one of the 4 directions randomly, use
the expression: rand() % 4
The function rand returns an integer, and finding the remainder of this integer divided by 4
results in getting one of the numbers 0, 1, 2, or 3. Use these 4 numbers to represent the 4
directions up, down, left and right.
The call to the function srand from the main function seeds the pseudo-random number
generator used by rand so that different sequences of numbers will be generated by calls to rand
each time the program is run.
Solution
#include //input output functions in C++
#include //rand() and srand() functions
#include //time() function for creating seed
#include
#include // for srand and rand
#inclu.
Im looking for coding help I dont really need this to be explained.pdfcontact41
I'm looking for coding help I don't really need this to be explained
I'm currently trying to draw a grid and a cube but I also need that cube to rotate
issue is I've been given so much information at once and there are so many missing pieces
mostly do to it not being explained or I've forgotten how to do it that I'm just at a lost
Here's my current code
Defines.h
#pragma once
#define Width 500
#define Height 500
#define NumPixels (Width * Height)
unsigned colorArray[NumPixels];
void ColorBuffer(unsigned int color)
{
for (unsigned int i = 0; i < NumPixels; i++)
{
colorArray[i] = color;
}
}
void drawPixel(unsigned int x, unsigned int y, unsigned int color)
{
unsigned int index = convertCoords(x, y);
colorArray[index] = color;
}
struct Float4
{
union
{
struct
{
float V[4];
};
struct
{
float x;
float y;
float z;
float w;
};
};
};
struct Matrix4x4
{
union
{
struct
{
float V[16];
};
struct
{
float xx;
float xy;
float xz;
float xw;
float yx;
float yy;
float yz;
float yw;
float zx;
float zy;
float zz;
float zw;
float wx;
float wy;
float wz;
float ww;
};
struct
{
Float4 AxisX;
Float4 AxisY;
Float4 AxisZ;
Float4 AxisW;
};
};
};
struct Vertex {
Float4 Position;
unsigned int color;
};
MyMath.h
#pragma once
#include "Defines.h"
float DotProduct(Float4 v1, Float4 v2)
{
return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z) + (v1.w * v2.w);
}
Matrix4x4 MultiplyMatrixByMatrix(const matrix& m1, const matrix& m2)
{
Matrix4x4 mOut;
mOut.xx = DotProduct(m1.Row0, m2.Column0);
mOut.xy = DotProduct(m1.Row0, m2.Column1);
mOut.xz = DotProduct(m1.Row0, m2.Column2);
mOut.xw = DotProduct(m1.Row0, m2.Column3);
mOut.yx = DotProduct(m1.Row1, m2.Column0);
mOut.yy = DotProduct(m1.Row1, m2.Column1);
mOut.yz = DotProduct(m1.Row1, m2.Column2);
mOut.yw = DotProduct(m1.Row1, m2.Column3);
mOut.zx = DotProduct(m1.Row2, m2.Column0);
mOut.zy = DotProduct(m1.Row2, m2.Column1);
mOut.zz = DotProduct(m1.Row2, m2.Column2);
mOut.zw = DotProduct(m1.Row2, m2.Column3);
mOut.wx = DotProduct(m1.Row3, m2.Column0);
mOut.wy = DotProduct(m1.Row3, m2.Column1);
mOut.wz = DotProduct(m1.Row3, m2.Column2);
mOut.ww = DotProduct(m1.Row3, m2.Column3);
return mOut;
}
unsigned int convertCoords(unsigned int x, unsigned int y)
{
return y * Width + x;
}
RasterFunc.h
#pragma once
#include "Shaders.h"
// Draws a line using one of the line equations.
void DrawLine(const Vertex& start, const Vertex& end)
{
// Copy input data and send through shaders
Vertex copy_start = start;
Vertex copy_end = end;
// Use vertex shader to modify incoming copies only.
if (VertexShader)
{
VertexShader(copy_start);
VertexShader(copy_end);
}
// original plotting variables adapted to use new cartesian data
SCREEN_XY screen_start = CartesianToScreen(copy_start);
SCREEN_XY screen_end = CartesianToScreen(copy_end);
// Standard line drawing code follows using integer coordinates...
for (numPixels)
{
A_PIXEL copyColor = currColor; // Just like a Vertex, copy original.
if (PixelShader) PixelShader(copyColor); // Modify copy.
PlotPixel(currX, c.
Exercise 1 (10 Points) Define a FixdLenStringList class that encaps.pdffms12345
EX 25-15 Decision on accepting additional business Brightstone Tire and Rubber Company has
capacity to produce 170,000 tires. Brightstone presently produces and sells 130,000 tires for the
North American market at a price of $175 per tire. Brightstone is evaluating a special order from
a European automobile com- pany, Euro Motors. Euro is offering to buy 20,000 tires for $116
per tire. Brightstone\'s accounting system indicates that the total cost per tire is as follows: OBJ.
1 $ 56 Direct materials Direct labor Factory overhead (60% variable) Selling and administrative
expenses (45% variable) Total 25 26 $129 Brightstone pays a selling commission equal to 5% of
the selling price on North Ameri- can orders, which is included in the variable portion of the
selling and administrative expenses. However, this special order would not have a sales
commission. If the order was accepted, the tires would be shipped overseas for an additional
shipping cost of $7.50 per tire. In addition, Euro has made the order conditional on receiving
European safety certification. Brightstone estimates that this certification would cost $165,000.
a. Prepare a differential analysis dated January 21 on whether to reject (Alternative 1) or accept
(Alternative 2) the special order from Euro Motors. b. What is the minimum price per unit that
would be financially acceptable to Brightstone?
Solution
1.
2.Differential AnalysisReject Order (Alt. 1) or Accept Order (Alt.2)January 21Reject
OrderAccept OrderDifferential Effect on Income(Alternative 1)(Alternative 2)(Alternative
2)Revenues 22,750,000 25,070,000
2,320,000(130000*175)(130000*175)+(20000*116)CostsDirect Materials
7,280,000 8,400,000 1,120,000(130000*56)(150000*56)Direct
Labor 2,860,000 3,300,000
440,000(130000*22)(150000*22)Variable Factory Overhead 1,950,000
2,250,000 300,000(60% of
25)(130000*60%*25)(150000*60%*25)Variable Selling and Admin Expenses15210001580000
59,000(45% of 26)(130000*45%*26)(130000*45%*26)+(20000*2.95Shipping cost
- 150,000
150,000(20000*7.5)Certification cost -
165,000 165,000Income (Loss) 9,139,000
9,225,000 86,000Bright stone should accept the special order from Euro Motors.
C++ Searching & Sorting5. Sort the following list using the select.pdfRahul04August
C++ Searching & Sorting
5. Sort the following list using the selection sort algorithm. Show the list after each iteration of
the outerforloop.
36, 55, 17, 35, 63, 85, 12, 48, 3, 66
6. Consider the following list: 5, 18, 21, 10, 55, 20
The first three keys are in order. To move 10 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
7. Consider the following list: 7, 28, 31, 40, 5, 20
The first four keys are in order. To move 5 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
8. Consider the following list: 28, 18, 21, 10, 25, 30, 12, 71, 32, 58, 15
This list is to be sorted using the insertion sort algorithm. Show the resulting list after six
passes of the sorting phase – that is, after six iterations of the for loop.
9. Perform the insertion sort algorithm using the following list of keys: 18, 8, 11, 9, 15, 20, 32,
61, 22, 48, 75, 83, 35, 3
Show the list after each iteration. Exactly how many key comparisons are executed to sort this
list using insertion sort?
10. a. The performance of bubble sort can be improved if we stop the sorting process as soon as
we find that in an iteration, no swapping of elements takes place. Write a function that
implements bubble sort algorithm using this fact.
b. Using the algorithm that you designed in part (a), find the number of iterations that are needed
to sort the list: 65, 14, 52, 43, 75, 25, 80, 90, 95.
11. Suppose that L is a sorted list of 4096 elements. What is the maximum number of
comparisons made by binary search to determine whether an item is in L?
12. Suppose that the elements of a list are in descending order, and they need to be put in
ascending order. Write a C++ function that takes as input an array of items in descending order
and the number of elements in the array. The function must not incorporate any sorting
algorithms, that is, no item comparisons should take place.
Solution
# include
# include
# include
#include
#include
#include
#include
// Function related to sorting in class sorting
class sorting
{
int array[50],array1[50],final[100],i,n,m,j;
public:
// Function to read an array
void read();
// Function to read arrays for merge sort
void read_mer();
// Function to display an array
void display();
// Function to perform bubble sort
void bub_sort();
// Function to perform selection sort
void Sel_sort();
// Function to perform insertion sort
void Ins_sort();
// Function to perform quick sort
void Qui_sort();
// Function to perform heap sort
void Heap_sort();
// Function to build a heap
void heap(int array[], int n);
// Function to interchange the value of root node with a
// child node in heap sort
void below_heap(int array[], int first, int last);
// Function to perform merges sort
void Mer_sort();
// Function to perform shell sort
void Shell_sort();
// Function to split the array into two halves during quick sort
void partition(int arra.
Read carefully and follow exactly Java You are to write a Breakou.pdfrupeshmehta151
Read carefully and follow exactly Java:
You are to write a Breakout game, using Java applets for animation. The requirements for this
program are designed so that you will also use an ArrayList, Generics, an abstract class,
polymorphism, and file I/O. Please read the following instructions very carefully, as they attempt
to explain how the various parts of the animation work; then you can update the applet, using
your knowledge of ArrayLists, Generics, abstract classes, and polymorphism.
Existing classes: There are a number of existing classes that are already written and ready for
use. They are contained in the file Breakout.java (they are not defined as public so they don’t
have to be in a file that matches their name). Please look them over carefully to see what
functionality is available. The classes (implemented inside Breakout.java) are:
Ball: this is defined as a subclass of Rectangle (even though that is geometrically invalid!). The
reason for this is so Ball can inherit data for its x coordinate, y coordinate, width, and height. It
also adds some data of its own (see the code) and methods (among others) to:
bounceLeftRight() (which changes the angle at which it moves after bouncing off a left or right
side),
bounceTopBottom() (which changes the angle at which it moves after bouncing off a top or
bottom)
move() (change its coordinates),
freeze()/unfreeze() itself,
It also inherits important methods from the Rectangle class
translate – changes its x and y coordinates respectively by the 2 numbers that are passed in
intersects(Rectangle other) – returns true if it intersects another Rectangle
intersection(Rectangle other) – returns the Rectangle that is the intersection
Paddle: this is also defined as a subclass of Rectangle so it inherits the same data/methods that
are described above for the Ball class. The fact that Ball and Rectangle are both Rectangles
means that code can ask a Ball if it intersects a Paddle, so it can easily tell when to make things
happen.
Wall: this is not in its own file, but rather in the Breakout.java file. Wall is also a subclass of
Rectangle to it is easy to determine if the ball has collided a wall.
The Breakout class (which is an Applet): if you look at the code for the Breakout class, you will
notice it has a number of things:
It is a subclass of Applet, so it inherits data and methods as well as the ability to function as an
Applet. For example, if you want to know the height of the applet you can ask it through the
this.getHeight(); method.
It implements the KeyListener interface, which gives it the ability to “listen” for keystrokes
from the keyboard. If you were to look up the KeyListener interface in the documentation, you
would find that anything that implements it must have the KeyPressed, KeyReleased, and
KeyTyped methods. These are all there; KeyPressed and KeyReleased set/unset Boolean flags
which remember that the left or right arrow keys are or are not being pressed.
It has a method called in.
write a program that prompts the user to enter the center of a recta.pdffonecomp
write a program that prompts the user to enter the center of a rectangle, width, and heigth and
displays the rectangle (using python)
Solution
center of rectangle display = input (\" please enter center of rectangle \");
height = input (\" please enter height \") ;
width = input (\" please enter width \");.
write 3 3 slide on China and Germany. Individual work (1) Choose a c.pdffonecomp
write 3 3 slide on China and Germany. Individual work (1) Choose a city, a region or a country
and a time whe it was especially successtul economically Produce one PowerPoint slide for each
of the following topics: Explain your choice and present basic facts Explain what was enabled
this place to achicve success Explain its decline . Send the PowerPoint presentation before Jan.
31 11:00pm
Solution
Chinese Economic growth miracle
Snapshot of Chinese economy:
Reasons behind success of Chinese economy:
First: Rural areas (1978-1984)
Non-farm enterprises are allowed to establish by government, which encourages
households’ savings (Spencer, 2012). It led to the increase in production and efficiency in the
agriculture system as well.
Urban Economic reforms (1985-1992)
It provided greater operational autonomy (Daniel & Germa, 2012) to the national
businesses. It made business more competitive under the presence of foreign businesses.
Administrative reform (1995)
Reforms in the rural-urban migration, banking system, tax system; international trade
and foreign investment took place.
Recent decline growth rate:
German Post War II Economic growth
German economy after WW-II:
High Growth Story:
From boom to burst:.
Why do negotiations fail O Conflicts are boring O Conflicts are co.pdffonecomp
Why do negotiations fail? O Conflicts are boring O Conflicts are complicated O Conflicts have
many elements (leader personalities, cultural norms, trust, psychology) O All answers listed
Solution
Negotiations failed because people do not consider the other side view
And the conflicts have many elements like culture norms leader personality trust etc.
What was the court-packing plan, and why is it sig- nificant to a.pdffonecomp
What was the \"court-packing plan,\" and why is it sig- nificant to administrative law? 5.
Solution
ANSWER:
The court packing plan was an attempt by Franklin D. Roosevelt for adding sympathetic justices
to the Supreme Court in getting the New Deal laws upheld as constitutional. The plan to teach
humility to these justices became known as the “court-packing” plan is widely categorised to be
one of the biggest blunders by President Franklin. The plan that called for up to six new justices
to be allowed to get added to the Supreme Court, emboldened Roosevelt\'s foes and persuaded
several lawmakers to become his foes. Although the objective of court-packing plan was to
improve the Court’s efficiency but President Roosevelt wanted the usage of the court-packing
plan to appoint justices who would not block the administration’s new deal programs thus holds
significance to administrative law.
Who are the major stakeholders that Sony must consider when developi.pdffonecomp
Who are the major stakeholders that Sony must consider when developing a communication
response?
Solution
Sony itself is a big brand also a public limited corporation,so the stakeholders consists of all of
the companies and those people who owned overused in the company.If any common person
purchase Sony shares on the stock market is also became a stakeholder..
What sort of prevention techniques would be useful when dealing with.pdffonecomp
What sort of prevention techniques would be useful when dealing with terrorism?(200 words)
Solution
ANS)
The govt should encourage moderates and provide right religious knowledge to vulnerable
people. e. g distorted intrepetations of quran should be challenged with the help of moderate
Muslims.
Preventing men and women from becoming terrorists; • Providing opportunities and support to
individuals on a path to, or involved in, VERLT to disengage; • Denying terrorism suspects the
support, resources and means to organize themselves or to plan and carry out attacks; • Preparing
for, and protecting against, terrorist attacks, in order to decrease the vulnerability of potential
targets, in particular critical infrastructure; • Pursuing terrorist suspects to apprehend them and
bring them to justice; and • Responding to terrorist attacks through proportionate measures to
mitigate the impact of such attacks and to assist victims.Refrain from providing any form of
support, active or passive, to entities or individuals involved in terrorist acts; • Prevent and
suppress the financing of terrori• Prevent the movement of terrorists or terrorist groups; • Deny
safe havens to those who finance, plan, support or commit terrorist acts, or provide safe havens; •
Ensure that any person who participates in the financing, planning, preparation or perpetration of
terrorist acts or in supporting terrorist acts is brought to justice; and • Afford each other the
greatest measure of mutual legal assistance in connection with criminal matters related to
terrorismsm; • Suppress the recruitment of members of terrorist groups; • Eliminate the supply of
weapons to terrorists;.
What are the main three types of organizational buyers How are they.pdffonecomp
What are the main three types of organizational buyers? How are they distinct from one another?
Solution
The main three types of buyers are Resellers, Producers and Institutional buyers.
Reseller include wholesalers and retailers who buy in large quantities from the manufacturers or
at the point of production to sell to the individual customers at a profit. The producers are the
manufacturers of certain goods or services that need several components to be sourced from
different manufacturers who specialise in their production. The institutional buyers are
Governments Hospitals or schools which buy in large quantities for their internal use.
The three differ in the purpose of the buying and with regards of the use of commodities bought.
The resellers buy to earn a profit by breaking the bulk and selling it in smaller quantities to
consumers, whereas the producers buy the intermediate parts of their final product, because it is
not economical for them to produce it in house. Institutional buyers do it to negotiate good price
for bulk purchases at attractive conditions..
The following code, is a one player battleship game in JAVA. Im tryi.pdffonecomp
The following code, is a one player battleship game in JAVA. Im trying to Enhance the game to
be a two player game (were a player plays aggainst a computer opponent). With TWO boards
displayed side by side. The player and the computer must take turns selecting the coordinates on
their own boards. (the ships cannot be placed adjacent to each other).
BattleShipGame.java
package battleship;
import java.util.ArrayList;
import java.util.Scanner;
public class BattleshipGame {
private Ocean ocean;
private boolean[][] availableSpot;
private Scanner sc;
public BattleshipGame() {
// define a new ocean and a new 2D array to store available coordinates
ocean = new Ocean();
availableSpot = new boolean[10][10];
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++){
availableSpot[i][j] = true;
}
}
}
/**
* prints the game menu and info
* //param select
*/
public void print(int select){
String info;
switch (select) {
case 1: info = \"Welcome to the World of Battleship!\";
break;
case 2: info = \"Enter coordinates to fire: \";
break;
case 3: info = \"Shots fired: \"+ocean.getShotsFired()+\", Ships sunk:
\"+ocean.getShipsSunk();
break;
case 4: info = \"Congratulations! You win!\";
break;
case 99: info = \"Invalid input. Please re-enter:\";
break;
case 100: info = \"--------------------------------------------\";
break;
case 101: info = \"\ ============================================\";
break;
default: info = \"Error selection\";
break;
}
System.out.println(info);
}
/**
* check if the input is valid
* //param input
* //return boolean
*/
public boolean checkValidInput(String input){
ArrayList numList = new ArrayList();
for (int i=0;i<10;i++){
numList.add(\"\"+i);
}
String[] coordinates = input.split(\" \");
//returns false if there are not 2 strings
if (coordinates.length!=2){
return false;
}
//returns false if any of the strings is not a single digit number
for (String str: coordinates){
if (numList.contains(str)==false){
return false;
}
}
//returns false if the coordinates have already been shot at
int row = Integer.parseInt(coordinates[0]);
int column = Integer.parseInt(coordinates[1]);
if (this.availableSpot[row][column]==false){
return false;
}
return true;
}
/**
* get the coordinates to shoot at from the String input
* //param input
* //return int[] coordinates
*/
public int[] getCoordinates(String input){
int[] coordinates = new int[2];
String[] strList = input.split(\" \");
int row = Integer.parseInt(strList[0]);
int column = Integer.parseInt(strList[1]);
coordinates[0] = row;
coordinates[1] = column;
return coordinates;
}
/**
* play the battleship game
*/
public void play(){
print(101);
print(1);
ocean.placeAllShipsRandomly();
boolean isGameOver = ocean.isGameOver();
sc = new Scanner(System.in);
//print the ocean and start the game
ocean.print();
print(3);
while (!isGameOver){
print(2);
String input = sc.nextLine();
//check if input is valid
while (!checkValidInput(input)){
print(99);
input = sc.nextLine();
}
//get coordinates and fire
int[] coord.
Sharks are able to maintain their fluids hypertonic to the ocean env.pdffonecomp
Sharks are able to maintain their fluids hypertonic to the ocean environment by accumulating:
(Choose One)
A. fluids in the rectal gland
B. fluid in the organ of Lorenzini
C. Calcium and phosphate
D. urea and TMAO
Solution
Ans D urea and TMAO
sharks store urea and TMAO ( trimethyl amine oxide). Urea is responsible for the metabolism of
different compounds in their body and help to excrete nitrogen out from their body..
Quantum Bank Inc. is a regional bank with branches throughout the so.pdffonecomp
Quantum Bank Inc. is a regional bank with branches throughout the southeast. In early 2011 the
bank launched an app for mobile devices that provided its customers with the ability to check
account balances, obtain information about the bank’s various services, obtain contact informa-
tion and email questions, and link to a variety of other useful sources of information. Given the
app’s tremendous success, competition from both traditional and nontradi- tional organizations,
and the desire to expand its presence beyond its current geographical area, Quantum decided to
significantly enhance its app. More specifically, Quantum would like to enhance its app to
include a mo payment service, allow customers to apply for credit cards and loans, open
accounts, and manage their investment portfolios. Vice-President of Information Systems, Stacey
Thomas, has been charged with overseeing the project. One of her first tasks was to select the
project manager. Because of the strategic importance of the project, she had a strong preference
for staffing the project internally as opposed to employing the services of one of the many
consulting firms available that specialize in these types of projects. After developing a list of ten
or so possible candidates to serve as project manager, she was finally able to pare the list down
to the two finalists described below. Bill Fence Bill joined Quantum in 2005 after gradu- ating
from a well-respected small private school with a degree in computer science. His first
assignment as a member of the bank’s help desk provided him with expo- sure to a variety of
areas in the bank. He quickly gained a reputation for being able to solve difficult technical
problems. In addition, users of the bank’s various compu- ter systems were often heard
commenting on how service oriented Bill was and on his ability to describe concepts in
nontechnical terms. Because of both his technical knowledge related to hardware and his ability
to program, Bill was selected to develop the bank’s first mobile app in 2010. Bill worked alone
on this project and had frequent meetings with one of the bank’s directors of Information
Systems, who supervised the project. Initially, the director did most of the design work and Bill
did the programming. Bill often proposed alternative ways for incorporating key features into the
app, and the director would choose among the options Bill identified. Toward the end of the
develop- ment project, Bill began to take a more active role in pro- posing features to include in
the app. The development project was largely completed on time and on budget considering the
changes in the scope of the project that were made as the project progressed. Several suggestions
that would have extended the app’s functionality were tabled to be considered as updates after
the app was officially launched. In his current position as Webmaster, Bill is in charge of
maintaining the bank’s Web site. Although Bill’s staff now includes a pr.
Neeb Corporation manufactures and sells a single product. The com.pdffonecomp
Neeb Corporation manufactures and sells a single product. The company uses units as the
measure of activity in its budgets 2 9 and performance reports, During January, the company
budgeted for 7,000 units, but its actual level The company has provided the following data
concerning the formulas used in its budgeting and its actual results for January of activity was
7040 units Fixed Variable element element per unit $27.20 per month Revenue Direct labor
Direct materials Manufacturing overhead Selling and administrative expenses Total expenses s$
3.20 9.70 1.10 27,000 0.46 $71,300 $%14.4 44,300
Solution.
Describe the primary, secondary, and tertiary structure of DNASo.pdffonecomp
Describe the primary, secondary, and tertiary structure of DNA
Solution
Answer:
1. Primary structure: DNA is made of nucleotides. Nucleotides are arranged in linear fashion by
the phosphodiester bonds. Linear structure of DNA is called primary structure.
2. Secondary structure: Helical tructure is called secondary structure. In this structure, two linear
polynucleotides are held together by hydrogen bonds and formrs double helical structure. The
DNA appears in different helices, hence the DNA is called as A-DNA, B-DNA and Z-DNA.
3. Tertiary structure: It is specific three dimensional shape of DNA that is formed by repeating
folding of DNA. This foldings are formed by the histone proteins. Several beads like structures
are formed in the tertiary structure called nucleosomes. Hence, the tertiary structure of DNA
appears like beads on string..
I need help with this program for java.The program you are given t.pdffonecomp
I need help with this program for java.
The program you are given to start with: Lab4.java
The input file of ints:10,000ints.txt
The input file of words:172,822words.txt
Execute your program like this: C:\\> java Lab4 10000ints.txt 172822words.txt
Be sure to put the ints filename before the words filename. The starter file will be expecting them
in that order.
Lab#4\'s main method is completely written. Do not modify main. Just fill in the methods. Main
will load a large arrays of int, and then load a large array of Strings. As usual the read loops for
each file will be calling a resize method as needed. Once the arrays are loaded, each array will be
tested for the presence of duplicates via calls to indexOfFirstDuplicate(). Do not do any trim
operation.
Here are the rules:
In your methods that look for the first occurrence of a duplicate in each array, you must sort the
arrays before looking for the dupe. Do not search the array for the dupe until it is sorted. We
require this because an unsorted array would require a quadratic algorithm (N squared via nested
loops). If you sort you array first you will only incur an O(n*Log2n) cost for the sort with an
additional O(n) for the search. This is the best that can be done without using a technology such
as hashing which you will use for your next lab.
Inside your method to find the dupe you must sort the array first.
Do not define/use any new type or data structure that we have not covered yet.
Your traversal of the array looking for the dupe should require no more than one pass.
Be as efficient as you can without breaking rule #2.
Assuming the array below, the 1st occurrence of a duplicate is at index 4, not 3, since the
element at [4] is the first index position where that value was seen for a second time. Be sure you
understand this. Do not report the index of the first occurrence of a value as being the index
where the duplicate occurred.
Your job will be to fill in the definitions of these methods below main
static int[] upSizeArr( int[] fullArray ); // incoming array is FULL. It needs it\'s capacity doubled
static String[] upSizeArr( String[] fullArray ); // incoming array is FULL. It needs it\'s capacity
doubled
static int indexOfFirstDupe( int[] arr, int count ); // returns ind of 1st occurrence of duplicate
value
static int indexOfFirstDupe( String[] arr, int count ); // returns ind of 1st occurrence of duplicate
value
Here is the starting file!
Solution
HI, Please find my implementation of all required methods.
Please let me know in case of any issue.
/* Lab4.java Reads two files into two arrays then checks both arrays for dupes */
import java.io.*;
import java.util.*;
public class Lab4
{
static final int INITIAL_CAPACITY = 10;
static final int NOT_FOUND = -1; // indexOfFirstDupe returns this value if no dupes found
public static void main (String[] args) throws Exception
{
// ALWAYS TEST FIRST TO VERIFY USER PUT REQUIRED INPUT FILE NAME ON
THE COMMAND LINE
if (args.length < 1 )
{
Syst.
Harrison works in a cubicle at a window next to Karen Ravenwoods cu.pdffonecomp
Harrison works in a cubicle at a window next to Karen Ravenwood\'s cubicle at Tabernacle
Insurers. One day, Harrison overhears Karen\'s supervisor make a comment that she\'d be more
successful if she spent as much time on shaping her list of prospective customers as she does on
shaping her body. Karen files a complaint of sex/gender discrimination with the EEOC and
Harrison is called to testify during the gation. The EEOC decides not to pursue the matter. A
month and a half after the investigation is closed, Tabernacle management moves Harrison from
his cubicle to a cubicle on a vacant floor. All other aspects of his job remain the same. Harrison
files a complaint of retaliation. 0 a. Harrison cannot pursue a case of retaliation because the
relocation of his work area between cubicles did not materially affect the terms, conditions, or
privileges of his employment at Tabernacle Ob. Harrison cannot prove a case of retaliation
because he is not in the same protected group as Karen Harrison cannot prove a case of
retaliation because the investigation uncovered no wrongdoing d. Harrison can prove a case of
retaliation
Solution
Answer d. Harrison can prove this as a case of retaliation, even if the investigation of Karen\'s
case didn\'t prove anything. To prove this Harrison need to show that
i) moving him to the vacant floor wasn\'t a strategic decision.
ii) If he\'d be in the same position as earlier, there wouldn\'t be any change in the performance of
the organization or the organization needn\'t change his position to get better output from him.
iii) He needs to show that he is the only one who has been moved to that floor and nobody else
was moved..
I need help creating a parametized JUnit test case for the following.pdffonecomp
I need help creating a parametized JUnit test case for the following class.
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import static java.lang.Integer.valueOf;
public class IntegerSet {
/**
* The only instance variable in the class. No other variables allowed.
*/
private List list;
public int size() {
return list.size();
}
public boolean isEmpty() {
return list.isEmpty();
}
/**
* Initializes the empty set.
*/
public IntegerSet() {
list = new LinkedList();
}
/**
* Initializes a set with the numbers in the argument.
*/
public IntegerSet(Integer[] integers) {
this();
if (integers == null) {
throw new NullPointerException(\"The argument cannot be null\");
} else {
for (Integer i : integers) {
if (!exists(i)) {
this.insertElement(i);
}
}
}
Collections.sort(list);
}
/**
* Inserts an integer to the set if the integer does not exist in the set
*/
public void insertElement(int i) {
if (!list.contains(i)) {
list.add(i);
}
}
/**
* Inserts to the set all the integers in the argument which do not exist in
* the set.
*/
public void insertAll(Integer[] data) {
if (data == null) {
throw new NullPointerException(\"The argument cannot be null\");
// throw new
// IllegalArgumentException(\"The argument cannot be null\");
} else {
Arrays.sort(data);
for (Integer num : data) {
if (!exists(num)) {
insertElement(num);
}
}
}
}
/**
* Deletes an integer from the set if it exists in the set.
*/
public void deleteElement(int i) {
list.remove(i);
}
/**
* Deletes all the elements in the set.
*/
public void deleteAll() {
list.clear();
}
/**
* Returns true if the argument exists in the set, false otherwise.
*/
public boolean exists(int i) {
return list.contains(i);
}
public String toString() {
char delimiter = \' \';
String str = \"[\";
for (Integer i : list) {
str += i;
str += delimiter;
}
return str + \"]\";
}
/**
* Finds the union of two sets. A null pointer is considered an empty set.
*
* Return \"new IntegerSet()\" when the result is an empty set.
*/
public static IntegerSet union(IntegerSet set1, IntegerSet set2) {
IntegerSet union = new IntegerSet();
if (set1.isEmpty() && set2.isEmpty()) {
return union;
}
if (!set1.list.isEmpty()) {
for (Integer num : set1.list) {
if (!union.list.contains(num)) {
union.list.add(num);
}
}
}
if (!set2.isEmpty()) {
for (Integer num : set2.list) {
if (!union.list.contains(num)) {
union.list.add(num);
}
}
}
return union;
}
/**
* Finds the intersection of two sets. A null pointer is considered an empty
* set.
*
* Return \"new IntegerSet()\" when the result is an empty set.
*/
public static IntegerSet intersection(IntegerSet set1, IntegerSet set2) {
IntegerSet intersection = new IntegerSet();
// check for null pointers
if (set1.list.isEmpty() || set2.list.isEmpty()) {
return intersection;
}
for (Integer num : set1.list) {
if ((!intersection.list.contains(num)) && set2.list.contains(num)) {
intersection.list.add(num);
}
}
return intersection;
}
/**
* Builds an array with the ele.
How do the genomes of Archaea and Bacteria compare Drag and drop th.pdffonecomp
How do the genomes of Archaea and Bacteria compare? Drag and drop the phrases on the left to
complete the sentences on the right. Part D Genome size of Archaea versus Bacteria How do the
genomes of Archaea and Bacteria compare? Drag and drop the phrases on the left to complete
the sentences on the right. Reset Help is/are larger than 1. Just by knowing that the
Thaumarchaeota are Archaea, it isare smaller than those of s possible to predict that their
genomes islare less complex than may contain a lower most Bacteria. proportion of coenzyme
genes than 2. Just by knowing that N. equitans is a parasite, it is may contain more than those of
unidentified genes than possible to predict that its genome most other hyperthermophiles. 3. Just
by knowing that a bacterium is a autotroph, it is than those of possible to predict that its genome
average heterotrophs. Hints My Answers Give Up Review Part Submit Genomic analyses can be
extremely useful in learning a great deal about microbes and may eventually lead to more
definite conclusions about differences between Archaea and Bacteria. These analyses can also be
used at a larger scale. Metagenomics involves studying all of the genetic material in an
environment, not just that in individual species.
Solution
(1) Archaea contain more unidentified genes than bacteria.
Therefore,
Just by knowing that the Thaumarchaeota are Archaea, it is possible to predict that their genomes
(may contain more unidentified genes than) those of most Bacteria.
(2) Parasites are smaller in size than hyperthermophiles.
Therefore,
Just by knowing tha N. equitans is a parasite, it is possible to predict that its genome (is/are
smaller than) those of most other hyperthermophiles.
(3) Genome of an autotroph is larger than a heterotroph.
Therefore,
Just by knowing that a bacterium is an autotroph, it is possible to predict that its genome ( is/are
larger than) those of average heterotrophs..
General question How would the technology affect who lives and who .pdffonecomp
General question: How would the technology affect who lives and who dies?
Solution
due to the technology there will be both good and bad also
who lives ..?
technology became the man\'s sophisticated tool ,with out technology man will lag ,
how man will get benifited from the technology.?
(iam giving some of the example how man is living with the help of technologies)
some of the major area\'s are
1)Medical --there is lot improvement in the medical sciencs which help the human to restore his
health
2)transport--the travelling time of the man decreases due to the technology improvement in
transportation
3)chemical -- due to the improvement in the technology of the chemical industries like creating
more sophistictaed
material which will help man
4)computer science-- man is getting benifited in most possible ways by the computer
technologies
who dies..?
due to the increasing of the technology there is an effect on the both human and wild life ,sea
creatures also
1)as technology increases the pollution also increases due to the pollution many sea ccreature
are dying as well as wild life also
2)there is an effect onn human also because as the days going on the life span of the human
being is decreases
and getting new diseases due to the pollution
3)man is gettig obesity due to the increasing of comforts.
Describe how partial diploids can be produced in E. coli.Solutio.pdffonecomp
Describe how partial diploids can be produced in E. coli.
Solution
Patial diploids can be produced by the transfer of genetic material of Hfr cell to an F- cell
through conjugation.When Hfr mates with F- cell through conjugation the chromosome acts as a
rolling circle transferring part of its genetic material across a conjugation bridge.Very rarely
whole portion of DNA is transferred,resulting very low chance of passing of F factor to the F-
cell.After that F- cell will contain part of Hfr,the exogene and its own genomic material the
endogene,at this stage the cell is called partial diploid..
4.2Why is there waiting in an infinite-source queuing systemmul.pdffonecomp
4.2
Why is there waiting in an infinite-source queuing system?
multiple-phase processing
slow service
variability in arrival and service rates
low utilization
poor scheduling of servers
Solution
The population or source in a queuing theory is divided into two parts including finite and
infinite population. In infinite source queuing system, the number of customers in the system has
no effect on the arrival pattern of customers. Besides it also experiences huge variability in the
arrival rate of customers as well as the service rates. Due to this reason there is waiting in
infinite-source queuing system.
Hence, the correct option is variability in arrival and service rates..
A single layer of gold atoms lies on a table. The radius of each gol.pdffonecomp
A single layer of gold atoms lies on a table. The radius of each gold atom is about 1.5×1010 m,
and the radius of each gold nucleus is about 7.0×1015 m. A particle much smaller than the
nucleus is shot at the layer of gold atoms.
Roughly, what is its chance (probability p) of hitting a nucleus and being scattered? (The
electrons around the atom have no effect.)
Solution
So we can estimate the probability neglecting the detailed crystal structure of the gold layer but
only from consideration of a single atom. The probability will be proportional to area of the
obstacle, so assuming circularity p=area of nucleus/area of the atom=(radius of the
nucleus)^2/(that of the atom)^2=2.2*10^(-9).
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
2024.06.01 Introducing a competency framework for languag learning materials ...
Hi there I am having difficulty in finalizing my Tetris game , below.pdf
1. Hi there I am having difficulty in finalizing my Tetris game , below I posted the codes for the
classes and I need the rest six pieces to be done. Can anybody help me here. It is a java code and
must use the code I posted bellow. Thanks,
Completing Tetris
[Description: shapes]
Overview
You will be completing the game Tetris. The features needed are
1. Adding the other 6 pieces
2. Adding the ability to rotate the pieces
Concepts
The purpose of this assignment is to gain experience with the following new concepts:
inheritance/class hierarchy
dynamic dispatch
algorithms
If you were not able to complete homework 1, please come see me to get a working solution.
Implementation Requirements
OTHER PIECES: The first step in the assignment is to add the other six pieces. Lets think a little
about the planning though; we don't want the Game class to have to know about all 7 different
piece types (we wouldn't want Game to have 7 different instance variables, 1 for each type. How
would it keep track of which one was current?) Instead, Game should know about 1 type (a super
type) and let dynamic dispatch do the work for us.
So to start, we need to redesign (or refactor) the current code. To do this, we want a super class
that contains everything common to all pieces; then sub classes for the individual pieces and
their individual needs. So what is the same about all the pieces?
the state currently handled by LPiece is common to all pieces
all the behaviors currently in LPiece are common to all pieces (except the constructor of course)
What is different about each piece:
How each individual playing piece is constructed
The implementation of how each rotates (the second feature for this assignment)
1) Therefore, start by breaking up the LPiece.java class into a super class and sub class. At this
point, test your program. It should run as it did before.
2) Now its time to add the other game pieces. You will need to figure out how to initialize the
pieces. This will be similar to how the L-shaped piece was done, and, in fact, you may find it
helpful to start each new class by copying the code from a previous shape and modifying it. The
pieces should be initialized in the following orientations:
2. [Description: shapes]
In the Game class, the piece instance variable must have a new type. What do you think it should
be?
You'll need to modify the Game class so that it doesn't always instantiate an LPiece piece, but
randomly chooses which shape to instantiate. (I strongly recommend creating 1 new shape at a
time and testing.)
ROTATION: The current tetris piece needs to be able to rotate in quarter turns clockwise each
time the 'r' key is pressed. As an example see the figure below illustrating how the L-shaped
piece rotates:
[Description: Lrotate]
Here is where dynamic dispatch will come in handy since each shape class must have its own
rotate implementation.
Update the existing classes (super and sub classes) to enable dynamic dispatch to work properly.
Modify the EventController class to react to the 'r' key.
Rules for Rotation: A piece should only rotate if
the grid squares that it would pass through during rotation are empty, and
the grid squares that it would occupy after rotating are all empty, and
all the squares are within the boundaries of the grid as the piece rotates.
Notice in the figure below how the different squares which make up the piece move their
positions. The figure shows the surrounding grid so you can see more clearly where the
movement happens. In particular, square 2 doesn't move at all, and 0,1,3 move relative to it.
Square 1 must "move through" the upper left square (row 0, col 0) before it stops in its final
location (row 0, col 1)
[Description: sampleRotation]
Square 2 is chosen as the pivot Square because it is used as the "base" square when the LPiece
is constructed. If you look at the constructor for the LPiece, the (r, c) parameters define the
position of the middle square on the long side. That is the square rotated around. For each shape,
you need to determine which square is closest to the "middle" and rotate around that.
For most pieces, the square to rotate around is the one establish by the (r,c) parameters. For the
square shape, though, it makes sense to consider the geometric center as the center of rotation
instead. This makes the rotation a trivial solution. (This is not true for the straight piece).
If a piece is rotated 4 times, it should be back in its original orientation and its original location
3. on the grid (assuming no other movement). In other words, no "drifting" over the grid.
Here's an example of the sort of thing that boundary checking on rotation should prevent:
[Description: boundary]
The other consideration when implementing this feature is "how to check if the rotate is legal?
Are the appropriate squares on the grid empty?" As we've discussed in class, implementation is
left as a developer's choice, but there are some guidelines you must follow:
Notice that in the move() method of a piece, the piece queries the individual squares if they can
move, and then tells them to move. At no time does the piece ever query the Grid directly.
Implement rotate the same way. Find out if the individual squares can move as needed, then
move them. You may add more methods to the Square public interface. In some rotations, a
Square actually has to move up. You may want to add an UP constant (to the appropriate class)
and modify the appropriate methods/comments in the Square class accordingly.
Written Report
Planning: How did you plan and organize your code?
Testing: How did you test your code? What sort of bugs did you encounter? Are there any
unresolved problems in the code? Be sure to list any ways in which the program falls short of the
specification.
Evaluate this project. What did you learn from it, or what did it help you remember? Was it
worth the effort? This could include things you learned about specifications and interfaces,
design issues, Java language issues, debugging, etc.
Please bring a printout of your written report to class the day after the due date.
Grading
/10 execution (does it work properly)
/4 design
/4 documentation (both internal and external), style
/2 written report
The codes are:
import java.awt.*;
/**
* Manages the game Tetris. Keeps track of the current piece and the grid.
* Updates the display whenever the state of the game has changed.
*
* @author Anthony Bladek
* @version 01/23/2017
4. */
public class Game
{
private Grid theGrid; // the grid that makes up the Tetris board
private Tetris theDisplay; // the visual for the Tetris game
private LPiece piece; // the current piece that is dropping
private boolean isOver; // has the game finished?
// possible move directions
public static final int LEFT = 0;
public static final int RIGHT = 1;
public static final int DOWN = 2;
/**
* Create a Tetris game
* @param Tetris the display
*/
public Game(Tetris display)
{
theGrid = new Grid();
theDisplay = display;
piece = new LPiece(1, Grid.WIDTH/2 -1, theGrid);
isOver = false;
}
/** Draw the current state of the game
* @param g the Graphics context on which to draw
*/
public void draw(Graphics g)
{
theGrid.draw(g);
if (piece != null)
piece.draw(g);
}
/** Move the piece in the given direction
5. * @param the direction to move
* @throws IllegalArgumentException if direction is not legal
*/
public void movePiece(int direction){
if (piece != null)
piece.move(direction);
updatePiece();
theDisplay.update();
theGrid.checkRows();
}
/**
* Returns true if the game is over
*/
public boolean isGameOver() {
// game is over if the piece occupies the same space as some non-empty
// part of the grid. Usually happens when a new piece is made
if (piece == null)
return false;
// check if game is already over
if (isOver)
return true;
// check every part of the piece
Point[] p = piece.getLocations();
for (int i = 0; i = WIDTH || col < 0 || col >= HEIGHT
*/
public void set(int row, int col, Color c) {
board[row][col].setColor(c);
}
/**
* Check for and remove all solid rows of squares
* If a solid row is found and removed, all rows above
* it are moved down and the top row set to empty
6. */
public void checkRows() {
boolean rowFull = true;
int i = HEIGHT - 1;
while (i > 0)
{
rowFull = true;
for(int j = 0; j< WIDTH;j++)
{
if(!isSet(i,j))// colum is empty don't need to remove a row
{
rowFull = false;
i --; // only go to the next row if it is not full;
break;
}
}
if(rowFull)
{
System.out.println("Found a full row. row: " + i );
// redraw the grid with the every row above the one found drawn with the value above it.
shiftRows(i);
setRowEmpty(0);
}
}
}
/* Shift all the Rows above the input down one row
* private method so it does not have to have public comments
* input parameter is integer value of the row that was found to be full.
*/
private void shiftRows(int fullRow)
{
for(int m = fullRow; m > 1; m--)
{
for(int n = 0; n < WIDTH;n++)
7. {
set(m,n,board[m-1][n].getColor());
}
}
}
/*Set one row to empty
Input is the row to set to empty.
*/
private void setRowEmpty(int rowNum)
{
for(int n = 0;n < WIDTH; n++)
set(rowNum,n,EMPTY);
}
/**
* Draw the grid on the given Graphics context
* @param Graphics you are drawing with.
*/
public void draw(Graphics g){
// draw the edges as rectangles: left, right in blue then bottom in red
g.setColor(Color.blue);
g.fillRect(LEFT - BORDER, TOP, BORDER, HEIGHT * Square.HEIGHT);
g.fillRect(LEFT + WIDTH * Square.WIDTH, TOP, BORDER, HEIGHT * Square.HEIGHT);
g.setColor(Color.red);
g.fillRect(LEFT - BORDER, TOP + HEIGHT * Square.HEIGHT,
WIDTH * Square.WIDTH + 2 * BORDER, BORDER);
// draw all the squares in the grid
for (int r = 0; r < HEIGHT; r++)
for(int c = 0; c < WIDTH; c++)
board[r][c].draw(g);
}
}
import java.awt.*;
/**
8. * An LPiece item in the Tetris Game.
*
* This piece is made up of 4 squares in the following configuration
* Sq
* Sq
* Sq Sq
*
* The game piece "floats above" the Grid. The (row, col) coordinates
* are the location of the middle Square on the side within the Grid
*
* @author CSC 143
*/
public class LPiece
{
private boolean ableToMove; // can this piece move
private Square[] square; // the Squares that make up this piece
// Made up of PIECE_COUNT squares
private Grid theGrid; // the board this piece is on
// number of squares in 1 Tetris game piece
private static final int PIECE_COUNT = 4;
/**
* Create an L-Shape piece. See class description for actual location
* of r and c
* @param r row location for this piece
* @param c column location for this piece
* @param g the grid for this game piece
*
*/
public LPiece(int r, int c, Grid g)
{
9. theGrid = g;
square = new Square[PIECE_COUNT];
ableToMove = true;
// Create the squares
square[0] = new Square(g, r - 1, c, Color.magenta, true);
square[1] = new Square(g, r, c , Color.magenta, true);
square[2] = new Square(g, r + 1, c, Color.magenta, true);
square[3] = new Square(g, r + 1, c + 1, Color.magenta, true);
}
/**
* Draw the piece on the given Graphics context
*/
public void draw(Graphics g){
for (int i = 0; i < PIECE_COUNT; i++)
square[i].draw(g);
}
/**
* Move the piece if possible
* Freeze the piece if it cannot move down anymore
* @param direction the direction to move
* @throws IllegalArgumentException if direction is not Square.DOWN,
* Square.LEFT, or Square.RIGHT
*/
public void move(int direction){
if (canMove(direction)){
for (int i = 0; i < PIECE_COUNT; i++)
square[i].move(direction);
}
// if we couldn't move, see if because we're at the bottom
else if (direction == Game.DOWN){
ableToMove = false;
}
}
10. /** Return the (row,col) grid coordinates occupied by this Piece
* @return an Array of (row,col) Points
*/
public Point[] getLocations(){
Point[] points = new Point[PIECE_COUNT];
for(int i = 0; i < PIECE_COUNT; i++) {
points[i] = new Point(square[i].getRow(), square[i].getCol());
}
return points;
}
/**
* Return the color of this piece
*/
public Color getColor() {
// all squares of this piece have the same color
return square[0].getColor();
}
/**
* Returns if this piece can move in the given direction
* @throws IllegalArgumentException if direction is not Square.DOWN,
* Square.LEFT, or Square.RIGHT
*/
public boolean canMove(int direction) {
if (!ableToMove)
return false;
//Each square must be able to move in that direction
boolean answer = true;
for (int i = 0; i < PIECE_COUNT; i++) {
answer = answer && square[i].canMove(direction);
}
return answer;
}
11. }
import java.awt.*;
/**
* One Square on our Tetris Grid or one square in our Tetris game piece
*
* @author Anthony Bladek
* @version 01/23/2017
*/
public class Square
{
private Grid theGrid; // the environment where this Square is
private int row, col; // the grid location of this Square
private boolean ableToMove; // true if this Square can move
private Color color; // the color of this Square
// possible move directions are defined by the Game class
// dimensions of a Square
public static final int WIDTH = 20;
public static final int HEIGHT = 20;
/**
* Constructor for objects of class Square
* @param g the Grid for this Square
* @param row the row of this Square in the Grid
* @param col the column of this Square in the Grid
* @param c the Color of this Square
* @param mobile true if this Square can move
*
* @throws IllegalArgumentException if row and col not within the Grid
*/
public Square(Grid g, int row, int col, Color c, boolean mobile){
if (row < 0 || row > g.HEIGHT-1)
throw new IllegalArgumentException("Invalid row =" + row);
if (col < 0 || col > g.WIDTH-1)
throw new IllegalArgumentException("Invalid column = " + col);
12. // initialize instance variables
theGrid = g;
this.row = row;
this.col = col;
color = c;
ableToMove = mobile;
}
/**
* Return the row for this Square
*/
public int getRow() {
return row;
}
/**
* Return the column for this Square
*/
public int getCol() {
return col;
}
/**
* Return true if this Square can move 1 spot in direction d
* @param direction the direction to test for possible move
* @throws IllegalArgumentException if direction is not valid
*/
public boolean canMove(int direction){
if (!ableToMove)
return false;
boolean move = true;
// if the given direction is blocked, we can't move
// remember to check the edges of the grid
switch(direction) {
case Game.DOWN:
13. if (row == (theGrid.HEIGHT -1) || theGrid.isSet(row + 1, col))
move = false;
break;
case Game.LEFT: // check conditions for left motion.
// stop motion if off the grid or another block is in the way.
if ((col == 0) || (theGrid.isSet(row, col -1)))
move = false;
break;
case Game.RIGHT: // check the conditions for right motion
// stop the motion if off the grid or another block is in the way.
if(col == (theGrid.WIDTH -1 ) || theGrid.isSet(row, col + 1))
move = false;
break;
default:
throw new IllegalArgumentException("Bad direction to Square.canMove()");
}
return move;
}
/** move Square in the given direction if possible
* Square will not move if direction is blocked, or Square is unable to move
* If attempt to move DOWN and it can't, the Square is frozen
* and cannot move anymore
* @param direction the direction to move
*/
public void move(int direction) {
if (canMove(direction)) {
switch(direction) {
case Game.DOWN:
row = row + 1;
break;
case Game.LEFT:
col = col - 1;
break;
case Game.RIGHT:
col = col + 1;
14. }
}
}
/** Change the color of the Square
* @param c the new color
*/
public void setColor(Color c) {
color = c;
}
/** Get the color of this Square
*/
public Color getColor() {
return color;
}
/**
* Draw this square on the given Graphics context
*/
public void draw(Graphics g) {
// calculate the upper left (x,y) coordinate of this square
int actualX = theGrid.LEFT + col * WIDTH;
int actualY = theGrid.TOP + row * HEIGHT;
g.setColor(color);
g.fillRect(actualX, actualY, WIDTH, HEIGHT);
}
}
/**
* Create and control the game Tetris.
*
* NOTE: when putting a Tetris object in a top-level container, make sure the Tetris
* object has the focus (use requestFocus())
*
15. * @author CSC 143 Based on a C++ version written by the
* University of Washington CSE department
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Tetris extends JPanel
{
private Game theGame;
/** Set up the parts for the Tetris game, display and user control
*/
public Tetris()
{
theGame = new Game(this);
GameController ec = new GameController(theGame);
addKeyListener(ec);
setBackground(Color.yellow);
}
/**
* Update the display
*/
public void update() {
repaint();
}
/**
* Paint the current state of the game
*/
public void paintComponent(Graphics g) {
super.paintComponent(g);
theGame.draw(g);
if (theGame.isGameOver() ) {
16. g.setFont(new Font("Palatino", Font.BOLD, 40));
g.setColor(Color.BLACK);
g.drawString("GAME OVER", 80, 300);
}
}
/* Create a game and play it*/
public static void play()
{
JFrame f = new JFrame("The Tetris Game");
Tetris t = new Tetris();
f.getContentPane().add(t);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(400,600);
f.validate();
f.setVisible(true);
t.requestFocus(); // so that Tetris (the JPanel) fires the keyboard events.
}
/**
* To be able to run from the command line or desktop
*/
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable() {
public void run() {
play();
}
});
}
}
And also the class diagram if possible
Thanks
Solution
17. import java.awt.*;
import java.util.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.util.*;
import java.awt.event.*;
import java.io.*;
public final class Piece {
// The body of the piece, each point is a coordinate specifying a block
private static Point[] body;
// Each element specifies how high the piece will land in the corresponding column
private int[] skirt;
private int width; // The width of the piece for the current rotation
private int height; // The height of the piece for the current rotation
private static Piece next; // The "next" rotation - note this is how a "piece" is really a list
static private Piece[] pieces; // singleton array of first rotations
private static final int INITIAL_HIGH_VAL = 10;
private static final int INITIAL_ZERO = 0;
private static final int NUMBER_OF_BLOCKS = 4;
//set height and width
//set skirt
private Piece(Point[] points) {
System.out.print("Creating a new piece");
//create the body
//body = new Point[points.length];
//for (int i=0; i< points.length; i++)
18. //body[i] = points[i];
printBody();
//initial value for height and width
height = width = INITIAL_HIGH_VAL;
//sets holders equal to actual points
for(int i = 0; i < body.length; i++){
int x = (int)(body[i].getX());
int y = (int)(body[i].getY());
//set height to greatest found value of y
if(height == INITIAL_HIGH_VAL || height <= y) height = y+1;
//set width to greatest found value of x
if(width == INITIAL_HIGH_VAL || width <= x) width = x+1;
}
System.out.print (" Height = " + height + " Width = " + width);
//creates the skirt of size width
skirt = new int[width];
for (int j=0; j< width; j++) skirt[j]=INITIAL_HIGH_VAL;
for(int j = 0; j < width; j++){
for(int i = 0; i < body.length; i++){
//if the x value is equal to the "x-value"
//of the skirt, then put the y-value for that
//x-value into the skirt, if its the lowest
if((int)(body[i].getX()) == j){
int y = (int)(body[i].getY());
if(y <= skirt[j]) skirt[j] = y;
}
}
}
for (int i=0; i< body.length; i++) {
if (!(body[i].getX() < width)) System.out.println("BAD");
19. }
System.out.println();
}
public int getWidth() {
//System.out.println("Piece tester wanted the width.");
return(width);
}
public int getHeight() {
//System.out.println("Piece tester wanted the height.");
return(height);
}
public Point[] getBody() {
System.out.print("GetBody:");
printBody();
return(body);
}
public void printBody() {
System.out.print("Body:");
for(int i= 0; i