Hello, I need some assistance in writing a java program THAT MUST USE STACKS (LIFO).
Create a Calculator w/ GUI
Write a program that graphically displays a working calculator for simple infix expressions that
consist of: single-digit operands, the operators: +, -, *, and /, and parentheses.
Make the following assumptions:
unary operators (e.g. -2) are illegal
all operations, including division, are integer operations (and results are integers)
the input expression contains no embedded spaces and no illegal characters
the input expression is a syntactically correct infix expression
division by zero will not occur (consider how you can remove this restriction)
Create a GUI application, the calculator has a display and a keypad of 20 keys, which are
arranged as follows:
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
As the user presses keys to enter an infix expression, the corresponding characters appear in the
display. The C (Clear) key erases all input entered so far; the < (Backspace) key erases the last
character entered. When the user presses the = key, the expression is evaluated and the result
appended to the right end of the expression in the display window. The user can then press C and
enter another expression. If the user presses the Q (Quit) key, the calculator ceases operation and
is erased from the screen.
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
Solution
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Calculator extends JFrame implements ActionListener {
JPanel[] row = new JPanel[5];
JButton[] button = new JButton[19];
String[] buttonString = {\"7\", \"8\", \"9\", \"+\",
\"4\", \"5\", \"6\", \"-\",
\"1\", \"2\", \"3\", \"*\",
\".\", \"/\", \"C\", \"\",
\"+/-\", \"=\", \"0\"};
int[] dimW = {300,45,100,90};
int[] dimH = {35, 40};
Dimension displayDimension = new Dimension(dimW[0], dimH[0]);
Dimension regularDimension = new Dimension(dimW[1], dimH[1]);
Dimension rColumnDimension = new Dimension(dimW[2], dimH[1]);
Dimension zeroButDimension = new Dimension(dimW[3], dimH[1]);
boolean[] function = new boolean[4];
double[] temporary = {0, 0};
JTextArea display = new JTextArea(1,20);
Font font = new Font(\"Times new Roman\", Font.BOLD, 14);
Calculator() {
super(\"Calculator\");
setDesign();
setSize(380, 250);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
GridLayout grid = new GridLayout(5,5);
setLayout(grid);
for(int i = 0; i < 4; i++)
function[i] = false;
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
FlowLayout f2 = new FlowLayout(FlowLayout.CENTER,1,1);
for(int i = 0; i < 5; i++)
row[i] = new JPanel();
row[0].setLayout(f1);
for(int i = 1; i < 5; i++)
row[i].setLayout(f2);
for(int i = 0; i < 19; i++) {
button[i] = new JButton();
button[i].setText(buttonString[i]);
button[i].setFont(font);
button[i].addActionListener(this);
}
display.setFont(font);
display.setEditable(false);
display.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
display.setPreferredSize(displayDimension);
for(int.
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfflashfashioncasualwe
Hello. I need help fixing this Java Code on Eclipse. Please fix parts indicated as \"//Fix\" or
\"//Fill-in\". The code given is the first image. Thank you! Sample outputs are given below along
with what the code is required to do. import java til. Random import java til. Scanner public class
GenCheeseShopv2 public static void intro (Stringt] names, double []prices int amounts Fill-in
public static void getAmount (Scanner input, String[] names, int[] amounts) public static void
itemizedList (String[] names, double Prices int[] amounts) Fill-i public static double
calcSubTotal (double prices, int amounts return 0; pub. lic static int discount (double subTotal
return 0; pub. lic static oid print Total (double subTotal int discount) Fill-in public static void mi
args final int MAXCH EESEE DO NOT CHANGE ANYTHING BELOW String[] names new
String CMAXCH EESE double[] prices new double EESE] int[] amounts new int
[MAXCHEESEJ Scanner input new Scanner (Syste intro names, prices, amounts get Amo unt
input, names, amounts double total calcSubTotal (prices, amounts if EESEE 0) System. out print
Display the itemized list? (1 for yes) int itemized input-nex if item 1) itemized List (names,
prices, amounts); System. out. println(); print Total(total, discount total));
Solution
import java.util.Random;
import java.util.Scanner;
public class GenCheeseShopv2 {
public static void intro(String[] names, double[] prices,int[] amounts){
System.out.println(\"We sell \"+names.length+\" kinds of cheese\");
for(int i=0;i0)
System.out.println(amounts[i]+\" lbs of \"+names[i]+\" @ \"+prices[i]+\" =
$\"+(amounts[i]*prices[i]));
}
}
public static double calcSubTotal( double[] prices,int[] amounts){
double subTotal=0;
for(int i=0;i100)
return 10;
else if(subTotal > 50)
return 25;
else
return 0;
}
public static void printTotal(double subTotal,int discount){
System.out.println(\"Sub Total : $\"+subTotal);
System.out.println(\"-Discount : $\"+discount);
System.out.println(\"Total : $\"+(subTotal-discount));
}
public static void main(String[] args){
final int MAXCHEESES=4;
String[] names = new String[MAXCHEESES];
double[] prices = new double[MAXCHEESES];
int[] amounts = new int[MAXCHEESES];
Scanner input = new Scanner(System.in);
intro(names, prices, amounts);
getAmount(input, names, amounts);
double total = calcSubTotal(prices, amounts);
if(MAXCHEESES>0){
System.out.println(\"Display the itemized list? (1 for yes)\");
int itemized = input.nextInt();
if(itemized==1){
itemizedList(names, prices, amounts);
}
}
System.out.println();
printTotal(total, discount(total));
}
}.
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfflashfashioncasualwe
Hello. I need help fixing this Java Code on Eclipse. Please fix parts indicated as \"//Fix\" or
\"//Fill-in\". The code given is the first image. Thank you! Sample outputs are given below along
with what the code is required to do. import java til. Random import java til. Scanner public class
GenCheeseShopv2 public static void intro (Stringt] names, double []prices int amounts Fill-in
public static void getAmount (Scanner input, String[] names, int[] amounts) public static void
itemizedList (String[] names, double Prices int[] amounts) Fill-i public static double
calcSubTotal (double prices, int amounts return 0; pub. lic static int discount (double subTotal
return 0; pub. lic static oid print Total (double subTotal int discount) Fill-in public static void mi
args final int MAXCH EESEE DO NOT CHANGE ANYTHING BELOW String[] names new
String CMAXCH EESE double[] prices new double EESE] int[] amounts new int
[MAXCHEESEJ Scanner input new Scanner (Syste intro names, prices, amounts get Amo unt
input, names, amounts double total calcSubTotal (prices, amounts if EESEE 0) System. out print
Display the itemized list? (1 for yes) int itemized input-nex if item 1) itemized List (names,
prices, amounts); System. out. println(); print Total(total, discount total));
Solution
import java.util.Random;
import java.util.Scanner;
public class GenCheeseShopv2 {
public static void intro(String[] names, double[] prices,int[] amounts){
System.out.println(\"We sell \"+names.length+\" kinds of cheese\");
for(int i=0;i0)
System.out.println(amounts[i]+\" lbs of \"+names[i]+\" @ \"+prices[i]+\" =
$\"+(amounts[i]*prices[i]));
}
}
public static double calcSubTotal( double[] prices,int[] amounts){
double subTotal=0;
for(int i=0;i100)
return 10;
else if(subTotal > 50)
return 25;
else
return 0;
}
public static void printTotal(double subTotal,int discount){
System.out.println(\"Sub Total : $\"+subTotal);
System.out.println(\"-Discount : $\"+discount);
System.out.println(\"Total : $\"+(subTotal-discount));
}
public static void main(String[] args){
final int MAXCHEESES=4;
String[] names = new String[MAXCHEESES];
double[] prices = new double[MAXCHEESES];
int[] amounts = new int[MAXCHEESES];
Scanner input = new Scanner(System.in);
intro(names, prices, amounts);
getAmount(input, names, amounts);
double total = calcSubTotal(prices, amounts);
if(MAXCHEESES>0){
System.out.println(\"Display the itemized list? (1 for yes)\");
int itemized = input.nextInt();
if(itemized==1){
itemizedList(names, prices, amounts);
}
}
System.out.println();
printTotal(total, discount(total));
}
}.
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.
Question Hello, I need some assistance in writing a java pr...Hel.pdfhainesburchett26321
Question: Hello, I need some assistance in writing a java pr...
Hello, I need some assistance in writing a java program using stacks (LIFO).
Create a Calculator w/ GUI
Write a program that graphically displays a working calculator for simple infix expressions that
consist of: single-digit operands, the operators: +, -, *, and /, and parentheses.
Make the following assumptions:
unary operators (e.g. -2) are illegal
all operations, including division, are integer operations (and results are integers)
the input expression contains no embedded spaces and no illegal characters
the input expression is a syntactically correct infix expression
division by zero will not occur (consider how you can remove this restriction)
Create a GUI application, the calculator has a display and a keypad of 20 keys, which are
arranged as follows:
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
As the user presses keys to enter an infix expression, the corresponding characters appear in the
display. The C (Clear) key erases all input entered so far; the < (Backspace) key erases the last
character entered. When the user presses the = key, the expression is evaluated and the result
appended to the right end of the expression in the display window. The user can then press C and
enter another expression. If the user presses the Q (Quit) key, the calculator ceases operation and
is erased from the screen.
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
Solution
import java.awt.*;
import java.awt.event.*;
public class MyCalculator extends Frame
{
public boolean setClear=true;
double number, memValue;
char op;
String digitButtonText[] = {\"7\", \"8\", \"9\", \"4\", \"5\", \"6\", \"1\", \"2\", \"3\", \"0\", \"+/-\",
\".\" };
String operatorButtonText[] = {\"/\", \"sqrt\", \"*\", \"%\", \"-\", \"1/X\", \"+\", \"=\" };
String memoryButtonText[] = {\"MC\", \"MR\", \"MS\", \"M+\" };
String specialButtonText[] = {\"Backspc\", \"C\", \"CE\" };
String buttonsText[]={\"C\",\"<\",\"Q\",\"/\"};
String buttonText1[]={\"7\",\"8\",\"9\",\"*\"};
String ButtonsText2[]={\"4\",\"5\",\"6\",\"-\"};
String ButtonText3[]={\"1\",\"2\",\"3\",\"+\"};
String ButtonText4[]={\"0\",\"(\",\")\",\"=\"};
MyDigitButton digitButton[]=new MyDigitButton[digitButtonText.length];
MyOperatorButton operatorButton[]=new MyOperatorButton[operatorButtonText.length];
MyMemoryButton memoryButton[]=new MyMemoryButton[memoryButtonText.length];
MySpecialButton specialButton[]=new MySpecialButton[specialButtonText.length];
Label displayLabel=new Label(\"0\",Label.RIGHT);
Label memLabel=new Label(\" \",Label.RIGHT);
final int FRAME_WIDTH=325,FRAME_HEIGHT=325;
final int HEIGHT=30, WIDTH=30, H_SPACE=10,V_SPACE=10;
final int TOPX=30, TOPY=50;
///////////////////////////
MyCalculator(String frameText)//constructor
{
super(frameText);
int tempX=TOPX, y=TOPY;
displayLabel.setBounds(tempX,y,240,HEIGHT);
displayLabel.setBackground(Color.BLUE);
displayLabel.setForeground(Color.WHITE);
add(displayLabel);
memLabel.setBounds(TOPX, TOPY+HEIGHT+ V_SPACE,.
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
Wiktor Toporek: TypeScript bez wątpienia jest obecnie pewnym standardem wśród obecnych rozwiązań powstałych w JavaScripcie. Ale czy poza byciem dodatkiem który uzupełnia odrobinę dokumentacje i deklaruje kontrakt jakiego typu parametry przyjmują i zwracają np. funkcje jakiejś biblioteki, można wycisnąć z niego coś więcej? Podczas prezentacji wykorzystamy TypeScript do granic możliwości, używając zaawansowanych technik które sprawiają że interfejs naszego API będzie sam kierował używających go developerów na drogę poprawnego użycia, które jest zgodne z naszymi (twórców) założeniami, poprawiając tym samym ich doświadczenia.
Write a program that obtains the execution time of selection sort, bu.pdfarri2009av
Write a java program called Question39 that does the following: Gets input for temperature
Utilizing a branching statement: If temperature is 76-100, call method outputHot passing the
temperature input as an argument. If temperature is 0-39, call method outputCold passing the
temperature input as an argument. If temperature is 40 to 75, call method outputJustRight
passing the temperature input as an argument. If temperature is outside these ranges, output
“Temperature outside range” to the screen. Be precise, import modules, include comments,
prologue, etc. as needed.
Solution
Question39.java
import java.util.Scanner;
public class Question39 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println(\"Enter temperature: \");
int temp = scan.nextInt();
if(temp >=76 && temp <=100){
outputHot(temp);
}
else if(temp >=0 && temp <=39){
outputCold(temp);
}
else if(temp >=40 && temp <=75){
outputJustRight(temp);
}
else{
System.out.println(\"Temperature outside range\");
}
}
public static void outputHot(int temp){
System.out.println(\"Temperature \"+temp+\" Hot \");
}
public static void outputCold(int temp){
System.out.println(\"Temperature \"+temp+\" Cold \");
}
public static void outputJustRight(int temp){
System.out.println(\"Temperature \"+temp+\" Just Right \");
}
}
Output:
Enter temperature:
45
Temperature 45 Just Right.
1sequences and sampling. Suppose we went to sample the x-axis from X.pdfrushabhshah600
1sequences and sampling. Suppose we went to sample the x-axis from Xmin to Xmax using a
step size of step
A)Draw a picture of what is going on.
B) Write a expression for n the total number of samples involved (in terms of Xmin, Xmax and
step)
C) Write out the sequence of x-samples
D) Write a direct and general expression for xi that captures the sequence
E) Write a recursive expression for the sequence
F) Write a program to compute and store the x-samples over the range -5x5 using a step size of
0.1 do everything in main ()
2 . We talked about the following string functions that are available in C (as long as you include
string.h):
int strlen(char str[])
void strcpy(char str1[], char str2[])
void strcat(char str1[], str2[])
Write your own versions of these functions; for example: int paul_strlen(int char str[]). Hint: for
your version of the strlen function, start at the first character in the array and keep counting until
you find the ‘\\0’ character (use a while loop for this). Note: Use your version of the strlen
function in the strcpy and strcat functions.
9. We want to insert a number into an array.
(a) Formulate the problem mathematically with two sequences: x and y. (b) Write a function of
the form:
insertNumIntoArray(int n, int array[], int num, int index)
The function inserts num into the array at the specified index. The rest of the array then follows.
For example, if num = 9 and index = 3 and array = [7 2 8 8 3 1 2] then the function will produce:
array = [7 2 8 9 8 3 1 2]
Note: assume that array is properly dimensioned to have at least 1 extra space for storage.
10. Repeat #2 by for the delete operation; that is, we want to delete a single element (at a
specified index) from an array; for example, suppose index = 3 and array = [50 70 10 90 60 20],
then the result will be
array: [50 70 10 60 20]
11. Repeat #2 by for an insert operation where we are inserting several values into the array. The
function should be of the form:
int insertArrayIntoArray(int n, int inArray[],
int nInsert, int insertArray[], int outArray[], int index)
The dimension of outArray is returned (explicitly). For example:
inArrayarray: [7 2 8 6 3 9]
insertArray: [50 60 70]
index: 2
outArray: [7 2 50 60 70 8 6 3 9]
Assume that outArray is large enough to hold all n + nInsert values.
Solution
#include
//Simulates strlen() library function
int paul_strlen(char str[])
{
int l;
for(l = 0; str[l] != \'\\0\'; l++) ;
return l;
}
//Simulates strcpy() library function
void paul_strcpy(char str1[], char str2[])
{
int c;
for(c = 0; str1[c] != \'\\0\'; c++)
str2[c] = str1[c];
str2[c] = \'\\0\';
printf(\"\ Original String: %s\", str1);
printf(\"\ Copied String: %s\", str2);
}
//Simulates strcat() library function
void paul_strcat(char str1[], char str2[])
{
int i, j;
for(i = 0; str1[i] != \'\\0\'; i++) ;
for (j = 0; str2[j] != \'\\0\'; i++, j++)
{
str1[i] = str2[j];
}
str1[i] = \'\\0\';
printf(\"\ Concatenated String: %s\", str1);
}
int main()
{
char data1[20], data2[20];
pri.
More instructions for the lab write-up1) You are not obli.docxgilpinleeanna
More instructions for the lab write-up:
1) You are not obligated to use the 'diary' function. It was presented only for you convenience. You
should be copying and pasting your code, plots, and results into some sort of "Word" type editor that
will allow you to import graphs and such. Make sure you always include the commands to generate
what is been asked and include the outputs (from command window and plots), unless the problem
says to suppress it.
2) Edit this document: there should be no code or MATLAB commands that do not pertain to the
exercises you are presenting in your final submission. For each exercise, only the relevant code that
performs the task should be included. Do not include error messages. So once you have determined
either the command line instructions or the appropriate script file that will perform the task you are
given for the exercise, you should only include that and the associated output. Copy/paste these into
your final submission document followed by the output (including plots) that these MATLAB
instructions generate.
3) All code, output and plots for an exercise are to be grouped together. Do not put them in appendix, at
the end of the writeup, etc. In particular, put any mfiles you write BEFORE you first call them.
Each exercise, as well as the part of the exercises, is to be clearly demarked. Do not blend them all
together into some sort of composition style paper, complimentary to this: do NOT double space.
You can have spacing that makes your lab report look nice, but do not double space sections of text
as you would in a literature paper.
4) You can suppress much of the MATLAB output. If you need to create a vector, "x = 0:0.1:10" for
example, for use, there is no need to include this as output in your writeup. Just make sure you
include whatever result you are asked to show. Plots also do not have to be a full, or even half page.
They just have to be large enough that the relevant structure can be seen.
5) Before you put down any code, plots, etc. answer whatever questions that the exercise asks first.
You will follow this with the results of your work that support your answer.
SAMPLE QUESTION:
Exercise 1: Consider the function
f (x,C)=
sin(C x)
Cx
(a) Create a vector x with 100 elements from -3*pi to 3*pi. Write f as an inline or anonymous function
and generate the vectors y1 = f(x,C1), y2 = f(x,C2) and y3 = f(x,C3), where C1 = 1, C2 = 2 and
C3 = 3. Make sure you suppress the output of x and y's vectors. Plot the function f (for the three
C's above), name the axis, give a title to the plot and include a legend to identify the plots. Add a
grid to the plot.
(b) Without using inline or anonymous functions write a function+function structure m-file that does
the same job as in part (a)
SAMPLE LAB WRITEUP:
MAT 275 MATLAB LAB 1 NAME: ...
public class TrequeT extends AbstractListT { .pdfinfo30292
/**
*/
public class Treque extends AbstractList {
/**
* You decide on the instance variables you need.
*/
public Treque(Class t) {
// Put your own code here
throw new UnsupportedOperationException(\"Constructor not yet implemented\");
}
public T get(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"get(i) not yet implemented\");
}
public T set(int i, T x) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"set(i,x) not yet implemented\");
}
public void add(int i, T x) {
if (i < 0 || i > size()) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"add(i,x) not yet implemented\");
}
public T remove(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"remove(i) not yet implemented\");
}
public int size() {
// Put your own code here
throw new UnsupportedOperationException(\"size() not yet implemented\");
}
public static void main(String[] args) {
//List tr = new ArrayDeque(Integer.class);
List tr = new Treque(Integer.class);
int K = 1000000;
Stopwatch s = new Stopwatch();
System.out.print(\"Appending \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Prepending \" + K + \" items...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.add(0, i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Midpending(?!) \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the back...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()-1);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the front...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(0);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the middle...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
}
}
-------------------------------------------------------------------
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
/**
* This class implements the List interface using a collection of arrays of
* sizes 1, 2, 3, 4, and so on. The main advantages of this over an
* implementation like ArrayList is that there is never more than O(sqr.
Gentle Introduction to Functional ProgrammingSaurabh Singh
This slide is basically aimed at professionals and students to introduce them with functional programming.
I haven't used much functional programming terminologies because I personally feel they could be overwhelming to people getting introduced to FP for the first time. For similar reasons I have deliberately avoided using any functional programming language and kept the discussions programming language agnostic as far as possible.
In order to determine the overall chromosome map for E. coli, four Hf.pdfFashionColZone
In order to determine the overall chromosome map for E. coli, four Hfr strains (#1, 2, 3, & 4)
were obtained from F+ ancestors. The start times of transfer during conjugation matings with F-
strains carrying auxotrophic and fermentation markers were determined for each Hfr strain, as
listed. Using the times for transfer of each maker, draw a unified chromosome map of E. coli,
showing the order and relative distances between these markers. Place the origin of transfer (site
of F insertion) on the map for each Hfr strain. What is the total length of the E. coli
chromosome, in transfer minutes?
Solution
The process of assigning genes to particular locations on a chromosome is known as
chromosome mapping and the map is called gene map. There are many methods used by
scientists to find out the correct location by mapping genes. By using these methods different
chromosome maps can be prepared like cytogenetic maps, linkage maps, DNA sequence maps or
physical maps. Hfr strain indicates a high frequency of recombinants. The polarity of the Hfr
chromosome is determined by the orientation in which F+ is inserted in it. The relative position
of chromosomes on a gene can be found out by linkage maps which are measured in time taken
by second gene in following the first one during conjugation. Here it is assumed that genes
separated by 10 minutes near the entry end are physically same distance apart as the genes
separated by 10 minutes at the F attachment site..
In a fantasy world where organisms can augment diffusion by using ma.pdfFashionColZone
In a fantasy world where organisms can augment diffusion by using magic to make molecules
move faster and in a non-random manner, which of the following would we expect to find?
Question 7 options:
Large, complex multicellular organisms with sophisticated internal transport organs
Large, complex multicellular organisms without any structures for bulk flow
Small, simple multicellular organisms with systems for sharing nutrients between cells
An absence of cell wall structures around unicellular organisms
Save
Large, complex multicellular organisms with sophisticated internal transport organs
Large, complex multicellular organisms without any structures for bulk flow
Small, simple multicellular organisms with systems for sharing nutrients between cells
An absence of cell wall structures around unicellular organisms
Solution
In a fantasy world where organisms can augment diffusion by using magic to make molecules
move faster and in a non-random manner,
Large, complex multicellular organisms with sophisticated internal transport organs because the
molecules are moving in a nn random fashion in order to streamline their movement it is
essential to have a multicellular organism with sophisticated internal transport organs..
More Related Content
Similar to Hello, I need some assistance in writing a java program THAT MUST US.pdf
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.
Question Hello, I need some assistance in writing a java pr...Hel.pdfhainesburchett26321
Question: Hello, I need some assistance in writing a java pr...
Hello, I need some assistance in writing a java program using stacks (LIFO).
Create a Calculator w/ GUI
Write a program that graphically displays a working calculator for simple infix expressions that
consist of: single-digit operands, the operators: +, -, *, and /, and parentheses.
Make the following assumptions:
unary operators (e.g. -2) are illegal
all operations, including division, are integer operations (and results are integers)
the input expression contains no embedded spaces and no illegal characters
the input expression is a syntactically correct infix expression
division by zero will not occur (consider how you can remove this restriction)
Create a GUI application, the calculator has a display and a keypad of 20 keys, which are
arranged as follows:
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
As the user presses keys to enter an infix expression, the corresponding characters appear in the
display. The C (Clear) key erases all input entered so far; the < (Backspace) key erases the last
character entered. When the user presses the = key, the expression is evaluated and the result
appended to the right end of the expression in the display window. The user can then press C and
enter another expression. If the user presses the Q (Quit) key, the calculator ceases operation and
is erased from the screen.
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
Solution
import java.awt.*;
import java.awt.event.*;
public class MyCalculator extends Frame
{
public boolean setClear=true;
double number, memValue;
char op;
String digitButtonText[] = {\"7\", \"8\", \"9\", \"4\", \"5\", \"6\", \"1\", \"2\", \"3\", \"0\", \"+/-\",
\".\" };
String operatorButtonText[] = {\"/\", \"sqrt\", \"*\", \"%\", \"-\", \"1/X\", \"+\", \"=\" };
String memoryButtonText[] = {\"MC\", \"MR\", \"MS\", \"M+\" };
String specialButtonText[] = {\"Backspc\", \"C\", \"CE\" };
String buttonsText[]={\"C\",\"<\",\"Q\",\"/\"};
String buttonText1[]={\"7\",\"8\",\"9\",\"*\"};
String ButtonsText2[]={\"4\",\"5\",\"6\",\"-\"};
String ButtonText3[]={\"1\",\"2\",\"3\",\"+\"};
String ButtonText4[]={\"0\",\"(\",\")\",\"=\"};
MyDigitButton digitButton[]=new MyDigitButton[digitButtonText.length];
MyOperatorButton operatorButton[]=new MyOperatorButton[operatorButtonText.length];
MyMemoryButton memoryButton[]=new MyMemoryButton[memoryButtonText.length];
MySpecialButton specialButton[]=new MySpecialButton[specialButtonText.length];
Label displayLabel=new Label(\"0\",Label.RIGHT);
Label memLabel=new Label(\" \",Label.RIGHT);
final int FRAME_WIDTH=325,FRAME_HEIGHT=325;
final int HEIGHT=30, WIDTH=30, H_SPACE=10,V_SPACE=10;
final int TOPX=30, TOPY=50;
///////////////////////////
MyCalculator(String frameText)//constructor
{
super(frameText);
int tempX=TOPX, y=TOPY;
displayLabel.setBounds(tempX,y,240,HEIGHT);
displayLabel.setBackground(Color.BLUE);
displayLabel.setForeground(Color.WHITE);
add(displayLabel);
memLabel.setBounds(TOPX, TOPY+HEIGHT+ V_SPACE,.
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
Wiktor Toporek: TypeScript bez wątpienia jest obecnie pewnym standardem wśród obecnych rozwiązań powstałych w JavaScripcie. Ale czy poza byciem dodatkiem który uzupełnia odrobinę dokumentacje i deklaruje kontrakt jakiego typu parametry przyjmują i zwracają np. funkcje jakiejś biblioteki, można wycisnąć z niego coś więcej? Podczas prezentacji wykorzystamy TypeScript do granic możliwości, używając zaawansowanych technik które sprawiają że interfejs naszego API będzie sam kierował używających go developerów na drogę poprawnego użycia, które jest zgodne z naszymi (twórców) założeniami, poprawiając tym samym ich doświadczenia.
Write a program that obtains the execution time of selection sort, bu.pdfarri2009av
Write a java program called Question39 that does the following: Gets input for temperature
Utilizing a branching statement: If temperature is 76-100, call method outputHot passing the
temperature input as an argument. If temperature is 0-39, call method outputCold passing the
temperature input as an argument. If temperature is 40 to 75, call method outputJustRight
passing the temperature input as an argument. If temperature is outside these ranges, output
“Temperature outside range” to the screen. Be precise, import modules, include comments,
prologue, etc. as needed.
Solution
Question39.java
import java.util.Scanner;
public class Question39 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println(\"Enter temperature: \");
int temp = scan.nextInt();
if(temp >=76 && temp <=100){
outputHot(temp);
}
else if(temp >=0 && temp <=39){
outputCold(temp);
}
else if(temp >=40 && temp <=75){
outputJustRight(temp);
}
else{
System.out.println(\"Temperature outside range\");
}
}
public static void outputHot(int temp){
System.out.println(\"Temperature \"+temp+\" Hot \");
}
public static void outputCold(int temp){
System.out.println(\"Temperature \"+temp+\" Cold \");
}
public static void outputJustRight(int temp){
System.out.println(\"Temperature \"+temp+\" Just Right \");
}
}
Output:
Enter temperature:
45
Temperature 45 Just Right.
1sequences and sampling. Suppose we went to sample the x-axis from X.pdfrushabhshah600
1sequences and sampling. Suppose we went to sample the x-axis from Xmin to Xmax using a
step size of step
A)Draw a picture of what is going on.
B) Write a expression for n the total number of samples involved (in terms of Xmin, Xmax and
step)
C) Write out the sequence of x-samples
D) Write a direct and general expression for xi that captures the sequence
E) Write a recursive expression for the sequence
F) Write a program to compute and store the x-samples over the range -5x5 using a step size of
0.1 do everything in main ()
2 . We talked about the following string functions that are available in C (as long as you include
string.h):
int strlen(char str[])
void strcpy(char str1[], char str2[])
void strcat(char str1[], str2[])
Write your own versions of these functions; for example: int paul_strlen(int char str[]). Hint: for
your version of the strlen function, start at the first character in the array and keep counting until
you find the ‘\\0’ character (use a while loop for this). Note: Use your version of the strlen
function in the strcpy and strcat functions.
9. We want to insert a number into an array.
(a) Formulate the problem mathematically with two sequences: x and y. (b) Write a function of
the form:
insertNumIntoArray(int n, int array[], int num, int index)
The function inserts num into the array at the specified index. The rest of the array then follows.
For example, if num = 9 and index = 3 and array = [7 2 8 8 3 1 2] then the function will produce:
array = [7 2 8 9 8 3 1 2]
Note: assume that array is properly dimensioned to have at least 1 extra space for storage.
10. Repeat #2 by for the delete operation; that is, we want to delete a single element (at a
specified index) from an array; for example, suppose index = 3 and array = [50 70 10 90 60 20],
then the result will be
array: [50 70 10 60 20]
11. Repeat #2 by for an insert operation where we are inserting several values into the array. The
function should be of the form:
int insertArrayIntoArray(int n, int inArray[],
int nInsert, int insertArray[], int outArray[], int index)
The dimension of outArray is returned (explicitly). For example:
inArrayarray: [7 2 8 6 3 9]
insertArray: [50 60 70]
index: 2
outArray: [7 2 50 60 70 8 6 3 9]
Assume that outArray is large enough to hold all n + nInsert values.
Solution
#include
//Simulates strlen() library function
int paul_strlen(char str[])
{
int l;
for(l = 0; str[l] != \'\\0\'; l++) ;
return l;
}
//Simulates strcpy() library function
void paul_strcpy(char str1[], char str2[])
{
int c;
for(c = 0; str1[c] != \'\\0\'; c++)
str2[c] = str1[c];
str2[c] = \'\\0\';
printf(\"\ Original String: %s\", str1);
printf(\"\ Copied String: %s\", str2);
}
//Simulates strcat() library function
void paul_strcat(char str1[], char str2[])
{
int i, j;
for(i = 0; str1[i] != \'\\0\'; i++) ;
for (j = 0; str2[j] != \'\\0\'; i++, j++)
{
str1[i] = str2[j];
}
str1[i] = \'\\0\';
printf(\"\ Concatenated String: %s\", str1);
}
int main()
{
char data1[20], data2[20];
pri.
More instructions for the lab write-up1) You are not obli.docxgilpinleeanna
More instructions for the lab write-up:
1) You are not obligated to use the 'diary' function. It was presented only for you convenience. You
should be copying and pasting your code, plots, and results into some sort of "Word" type editor that
will allow you to import graphs and such. Make sure you always include the commands to generate
what is been asked and include the outputs (from command window and plots), unless the problem
says to suppress it.
2) Edit this document: there should be no code or MATLAB commands that do not pertain to the
exercises you are presenting in your final submission. For each exercise, only the relevant code that
performs the task should be included. Do not include error messages. So once you have determined
either the command line instructions or the appropriate script file that will perform the task you are
given for the exercise, you should only include that and the associated output. Copy/paste these into
your final submission document followed by the output (including plots) that these MATLAB
instructions generate.
3) All code, output and plots for an exercise are to be grouped together. Do not put them in appendix, at
the end of the writeup, etc. In particular, put any mfiles you write BEFORE you first call them.
Each exercise, as well as the part of the exercises, is to be clearly demarked. Do not blend them all
together into some sort of composition style paper, complimentary to this: do NOT double space.
You can have spacing that makes your lab report look nice, but do not double space sections of text
as you would in a literature paper.
4) You can suppress much of the MATLAB output. If you need to create a vector, "x = 0:0.1:10" for
example, for use, there is no need to include this as output in your writeup. Just make sure you
include whatever result you are asked to show. Plots also do not have to be a full, or even half page.
They just have to be large enough that the relevant structure can be seen.
5) Before you put down any code, plots, etc. answer whatever questions that the exercise asks first.
You will follow this with the results of your work that support your answer.
SAMPLE QUESTION:
Exercise 1: Consider the function
f (x,C)=
sin(C x)
Cx
(a) Create a vector x with 100 elements from -3*pi to 3*pi. Write f as an inline or anonymous function
and generate the vectors y1 = f(x,C1), y2 = f(x,C2) and y3 = f(x,C3), where C1 = 1, C2 = 2 and
C3 = 3. Make sure you suppress the output of x and y's vectors. Plot the function f (for the three
C's above), name the axis, give a title to the plot and include a legend to identify the plots. Add a
grid to the plot.
(b) Without using inline or anonymous functions write a function+function structure m-file that does
the same job as in part (a)
SAMPLE LAB WRITEUP:
MAT 275 MATLAB LAB 1 NAME: ...
public class TrequeT extends AbstractListT { .pdfinfo30292
/**
*/
public class Treque extends AbstractList {
/**
* You decide on the instance variables you need.
*/
public Treque(Class t) {
// Put your own code here
throw new UnsupportedOperationException(\"Constructor not yet implemented\");
}
public T get(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"get(i) not yet implemented\");
}
public T set(int i, T x) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"set(i,x) not yet implemented\");
}
public void add(int i, T x) {
if (i < 0 || i > size()) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"add(i,x) not yet implemented\");
}
public T remove(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"remove(i) not yet implemented\");
}
public int size() {
// Put your own code here
throw new UnsupportedOperationException(\"size() not yet implemented\");
}
public static void main(String[] args) {
//List tr = new ArrayDeque(Integer.class);
List tr = new Treque(Integer.class);
int K = 1000000;
Stopwatch s = new Stopwatch();
System.out.print(\"Appending \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Prepending \" + K + \" items...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.add(0, i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Midpending(?!) \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the back...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()-1);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the front...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(0);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the middle...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
}
}
-------------------------------------------------------------------
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
/**
* This class implements the List interface using a collection of arrays of
* sizes 1, 2, 3, 4, and so on. The main advantages of this over an
* implementation like ArrayList is that there is never more than O(sqr.
Gentle Introduction to Functional ProgrammingSaurabh Singh
This slide is basically aimed at professionals and students to introduce them with functional programming.
I haven't used much functional programming terminologies because I personally feel they could be overwhelming to people getting introduced to FP for the first time. For similar reasons I have deliberately avoided using any functional programming language and kept the discussions programming language agnostic as far as possible.
In order to determine the overall chromosome map for E. coli, four Hf.pdfFashionColZone
In order to determine the overall chromosome map for E. coli, four Hfr strains (#1, 2, 3, & 4)
were obtained from F+ ancestors. The start times of transfer during conjugation matings with F-
strains carrying auxotrophic and fermentation markers were determined for each Hfr strain, as
listed. Using the times for transfer of each maker, draw a unified chromosome map of E. coli,
showing the order and relative distances between these markers. Place the origin of transfer (site
of F insertion) on the map for each Hfr strain. What is the total length of the E. coli
chromosome, in transfer minutes?
Solution
The process of assigning genes to particular locations on a chromosome is known as
chromosome mapping and the map is called gene map. There are many methods used by
scientists to find out the correct location by mapping genes. By using these methods different
chromosome maps can be prepared like cytogenetic maps, linkage maps, DNA sequence maps or
physical maps. Hfr strain indicates a high frequency of recombinants. The polarity of the Hfr
chromosome is determined by the orientation in which F+ is inserted in it. The relative position
of chromosomes on a gene can be found out by linkage maps which are measured in time taken
by second gene in following the first one during conjugation. Here it is assumed that genes
separated by 10 minutes near the entry end are physically same distance apart as the genes
separated by 10 minutes at the F attachment site..
In a fantasy world where organisms can augment diffusion by using ma.pdfFashionColZone
In a fantasy world where organisms can augment diffusion by using magic to make molecules
move faster and in a non-random manner, which of the following would we expect to find?
Question 7 options:
Large, complex multicellular organisms with sophisticated internal transport organs
Large, complex multicellular organisms without any structures for bulk flow
Small, simple multicellular organisms with systems for sharing nutrients between cells
An absence of cell wall structures around unicellular organisms
Save
Large, complex multicellular organisms with sophisticated internal transport organs
Large, complex multicellular organisms without any structures for bulk flow
Small, simple multicellular organisms with systems for sharing nutrients between cells
An absence of cell wall structures around unicellular organisms
Solution
In a fantasy world where organisms can augment diffusion by using magic to make molecules
move faster and in a non-random manner,
Large, complex multicellular organisms with sophisticated internal transport organs because the
molecules are moving in a nn random fashion in order to streamline their movement it is
essential to have a multicellular organism with sophisticated internal transport organs..
Explain how consumer judges the quality of service (Including price .pdfFashionColZone
Explain how consumer judges the quality of service (Including price as indicator of quality)
Solution
It is more difficult for consumers to evaluate the quality of service than the quality of products.
This is true because of certain distinctive characteristics of services; They are intangible, they are
variable, they are perishable, and they are simultaneously produced and consumed. To overcome
the fact that consumers are unable to compare competining services side-by-side as they do with
competing pproducts, consumers rely on surrogate cues (i.e., extrinsic cues) to evaluate the
service quality. It must be noted here that the service quality is a perception of the consumer and
not described in absoolute terms like in the case of products.
Perceived service value has been described as a trade-off between the perceived benefits
(quality) of service and the perceived sacrifice - both monetary and non-monetary - necessary to
acquire it. Consumers rely on price as an indicator of service quality. Consumers using a price /
quality relationship are actually relying on a well-known (and, hence, more expensive) brand
name as an indicator of quality without actually relying directly on price per se. Consumers also
use price and brand to evaluate the prestige of the product but do not generally use these cues
when they evaluate the service delivery and performance. Since, price is so often considered as
an indicator of quality, consumers perceive a service to be of higher quality based on the pricing
of the service. However, on other hand, when the consumers evaluate the service more critically,
then they rely less on the price and brand as indicators of service quality..
Early Americans did not practice equality according to today’s defin.pdfFashionColZone
Early Americans did not practice equality according to today’s definitions; however, the concept
of equality has always been an important part of American rhetoric with an evolving
definition. Politicians considered women, blacks, and the lower classes as “dependent”, as they
owed their livelihood to someone else. They were thought not to have the “independence” to
form conclusions. How is Mercy Otis Warren an example against this theory?
Solution
Mercy Otis Warren was a political writer and propagandist of the American Revolution. In the
eighteenth century, topics such as politics and war were thought to be the province of men. Few
men and fewer women had the education or training to write about these subjects. Warren was an
exception. During the years before the American Revolution, Warren published poems and plays
that attacked royal authority in Massachusetts and urged colonists to resist British infringements
on colonial rights and liberties.
During the debate over the United States Constitution in 1788, she issued a pamphlet,
Observations on the new Constitution, and on the Federal and State Conventions written under
the pseudonym \"A Columbian Patriot,\" that opposed ratification of the document and
advocated the inclusion of a Bill of Rights. Observations was long thought to be the work of
other writers, most notably Elbridge Gerry. It was not until her descendant, Charles Warren,
found a reference to it in a 1787 letter to British historian, Catharine Macaulay, that Warren was
accredited authorship.In 1790, she published a collection of poems and plays under her own
name, a highly unusual occurrence for a woman at the time. In 1805, she published one of the
earliest histories of the American Revolution, a three-volumeHistory of the Rise, Progress, and
Termination of the American Revolution, the first history of the American Revolution authored
by a woman..
Do you think that the level of prosperity of a given society influen.pdfFashionColZone
Do you think that the level of prosperity of a given society influences the development of
mathematics and scientific knowledge in that society? Provide examples of how these issues
might be connected.
Solution
Eighty percent of the scientists who have ever lived are alive today.More surprisingly, the same
statement could have been made one, or two centuries ago.Not only the science has been
expanding rapidly since the Scientific revolution of seventeenth century, it has emerged as a
dominant force in our culture.This suggests why many eduvators have realized that an
understanding of the evolution of science and of its influence on our society is a vital part of our
education.
Contemprary societies are marked by new global trends-- economic, cultural, technological, and
environmental shifts that are part of a rapid and uneven wave of globalization.The growing
global interdependence that characterizes our time calls for a generation of individuals who can
engage in global problem solving and participate simultaneously in local, national and global
civic life.This surely asks for the development of mathematics and scientific knowldge in our
society which is definitely growing in terms of prosperity.
The history of Mathematical notation includes the commencement, progress and cultural
diffusion of mathematical symbols and the conflicts of the method of notation confronted in
notation\'s move to popularity .Written Mathematics began with the numbers expressed as tally
marks, with each tally representing a single unit.The numerical symbols consisted of strokes or
notches cut in wood or stone, an intelligible alike to all nations.For example one notch in a bone
represented one animal, or person, or anything else.
If we look at today\'s socitey than all these sybols have developed in a certain way with each
growing period.These have evolved over years now and this shows how with the growth and
prosperity the developments in Mathematics is related.
The necessaity of accurately tracking the latitude and longitude for instance has influenced the
developement in Mathematics and Science..
Design a circuit that detect the sequence 0110. Draw the Moore sta.pdfFashionColZone
Design a circuit that detect the sequence 0110.
Draw the Moore state machine for detecting non-overlapping sequences
Write the truth table that shows the next state based on T flip flops
Draw the circuit
Re-do the More state machine graph for overlapping sequences (do the state machine only)
Solution
A)This sort of situation might arise for a simple code lock, where the user must enter the correct
4 bits to open the lock. If the user doesn’t input the correct 4 bits, they must start over. Or, it
might be used in a simple communication system which receives bits off a line one at a time, and
the word size is 4 bits. In this case, the patterns might be start and stop signals, or some other
communication protocol-related information. The input is defined as X. Thus, the value of X is
the value of the input line in a given clock cycle. The output, Y, goes high for 1 clock cycle as
soon as it receives the 4th bit that matches a pattern. We have only one input and only one
output, so we don’t need to use ASM charts. We can use a simple state diagram. Note that
because the output must go high as soon as the 4th matching bit is received, we need this to be a
Mealy machine. Also, note that in this example, when we are looking for 1010, we assume the
most significant bit is the first bit received, so the order of the inputs would be 1-0-1-0, not 0-1-
0-1.
Our state machine starts in a state in which we have received no bits. We will call this state
START. The state transitions will be depending on whether the input X is a 0 or 1 – we can
essentially use the states to record which values have been received. If the input is 0, we
transition to a state called S0; if X is 1, we transition to S1. These states are named after the
value received in the previous clock cycle. From each of S0 and S1, we can likewise go to new
states based on the value of X. If in S0, and X is 0, we go to state S00; if X is 1, we go to state
S01. Similarly, if in S1, and X is 0, we go to state S10; if X is 1, we go to state S11. Again, the
states are named after the two previously received values. Now, each of those four states can
again go to one of two possible states, based on the value of X. The states are S000, S001, S010,
S011, S100, S101, S110, S111. At this point, the state machine knows we have received 3 bits,
and knows what those 3 bits are. When it receives the next bit, it can determine whether a
matching sequence was input, or whether we need to restart.
So, S000, S001, S010, S100, S110, and S111 all transition back to START and output 0, no
matter what the input, because none of those states correspond to having received the first 3 bits
of sequences 0110 or 1010. States S011 and S101, however, do depend on the input. They both
still transition back to START, but if the input is 0, the output is 1. Otherwise, the output remains
0. Thus the state machine meets our design requirements.
So we have a state machine that has 15 states. 15 states is quite a lot. This requ.
Cyanide is a potent toxin that can kill a human in minutes. It funct.pdfFashionColZone
Cyanide is a potent toxin that can kill a human in minutes. It functions by inhibiting complex IV
of the electron transport chain (ETC). Based on your understanding of cellular respiration,
Illustrate the ETC. Be sure to include all components of the electron transport chain, electron
donors, and the movement of both electrons and protons.
Indicate with an “X” the site of action for cyanide (color might be helpful)
Explain why cyanide exposure is lethal.
Briefly describe the effects it has on each process of cellular respiration.
Solution
Cyanide poisoning occurs when a person comes in direct exposure of cyanide gas. This cyanide
gas interfere with complex IV of electron transport chain. This complex IV is also known as
cytochrome C oxidase. it is a large transmembrane protein complex found in mitochondria of
human cells. This mitochondra is the cell organalle where cellular respiration through electron
transport chain occurs.
Electron transport chain: There are 5 components of electron transport chain which are found on
the inner membrane of mitochondria.
1. Nicotonamide nucleotides
2. Flavoproteins
3. Iron - sulphur proteins
4. Quinones and
5. Cytochromes
cytochrome I
cytochrome II
cytochrome III
cytochrome IV
During cellular respiration the cells consume oxygen for the oxidation of nutrients ( glucose,
fatty acids, amino acids) and this oxygen act as electron accapter. After kreb\'s cycle the electron
moves via NAD to FAD and then electron moves to cytochromes I to cytochrome II, cytochrome
III and finally to cytochrome IV. This cytochrome IV transfer electrons to oxygen atom due to
which oxygen atoms consumes 4 H+ ion from matrix to form water molecule. Due to
consumption of 4 hydrogen ion from matrix, 4 hydrogen ions from outside the mitochondria
enters to the matrix and converts ADP into ATP to store the biochemical energy. Hence the
whole process of electron transport chain can be shown as follows:
Electron------NAD------FAD-------Cytochrome I------cytochrome III-----\"X\"----cytochrome IV
Transfer of electrons from cytochrome III to cytochrome IV is catalysed by enzyme cytochrome
c oxidase (complex IV). During cyanide poisoning the cyanide ion interfers with this cytochrome
c oxidase enzyme and inhibit the transfer of electrons from cytochrome III to IV.
Since cyanide poisonong interferes with cellular respiration it interrupts the energy source for
humane being. It creates hypoxia. Thatswhy cyanide poisoning could be lethal..
A Fullerene is a 3-regular planar graph with faces of degree 5 and 6.pdfFashionColZone
A Fullerene is a 3-regular planar graph with faces of degree 5 and 6. Let P be the number of
pentagons (degree 5 faces) and H be the number of hexagons (degree 6 faces). Given that a
Fullerene has v vertices, determine P and H as functions of v.
Solution
Here there are P faces of degree five( pentagons ) and H faces of degree six( Hexagons)
Then there are F = P+H faces
we know from eulers formula that F= 2 + E - V
By 3 Regularity we know 2E = 3V
so P+H = F = 2 + 3V/2 -V
= 2 + V/2
Further by handshaking for planar graphs we know
2E = 5P + 6H
so , 3V= 2 E = 5P + 6H
= 5(P+H) + H
= 5(2+ v/2) + H
This tells us that
v = 2H + 20,
so H = V/2 - 10
as P + H = 2+V/2
we conclude
P = 2+ V/2 - H
= 2+ V/2 - (V/2 - 10)
= 12.
Assume that the paired date came from a population that is normally .pdfFashionColZone
Assume that the paired date came from a population that is normally distributed. Using a .05
significance level, find d, Sd, the test t statistic, and the critical values to test the claim that
Ud=0.
x 7 10 12 12 3 15 17 8
y 12 12 7 8 8 11 12 5
d=
Sd=
t=
t a/2 = +-
Round all to three decimal places.
Thank you in advance!!
Solution.
Briefly describe three processing schema used in cochlear implants..pdfFashionColZone
Briefly describe three processing schema used in cochlear implants.
Solution
ecology:
It is a branch of biological science that deals with the relations of different organisms to one
another and to their physical surroundings which can be varies species to species. It is a very
much scientific approach to study the relationship between organism and the environment
system. geography and earth science are equally important for ecology.
example for how ecology is integrative across a suite of biological discipline:
we can say that the biodiversity is the greatest example of ecology which is hugely connected
with biological descipline. food pyramid, food chain,food web maintain the relationship between
different species and also with ecosystem.Ecosystems is always sustaining life-supporting
functions and produce natural things like biomass production which help to grow. wetland
management is also another example.
an example of the link between ecology and evolution
Life history,Natural selection, adaptation, development, inheritance and populations are different
type of example between the link of ecology and evolution. morphological, behaviorial study
generally helping us to study evolution. taxonomy is also very important terms here.
ecology and evolution inform conservation biology
Firstle I can say that evolutionary biology is a necessary component for conservation or you can
say conservation biology in terms of biomass or system and sorroundings. These are all the
primary lenders behind long-term, sustainable biological collections, because we need to know
what actually exists in order to better understand organism , species, geographical and earth and
natural evolutionary history. Now The second most important key we can say that by
understanding lots of different causes of diversification. And finally we know that evolution
allows us for an better understanding of the potential responses to human disturbance like in
population size..
A satellite moves in a circular orbit around Earth at a speed of 470.pdfFashionColZone
A satellite moves in a circular orbit around Earth at a speed of 4705 m/s.
(a) Determine the satellite\'s altitude above the surface of Earth.
m
(b) Determine the period of the satellite\'s orbit.
h
.
Solution
r = G M / v2 = (6.673 * 10-11 * 5.97 * 1024) / (47052)
= 1.799 * 107 m
The satellite\'s altitude above the Earth\'s surface is h = r - R
= (1.799 * 107) - (6.378 * 106) = 1.16 * 107 m
The satellite\'s orbital period T = 2 pi r /v
= (2 pi * 1.799 * 107) / 4705
= 24024 sec = 6.67 hrs.
7. What do we mean by “spreading signal”in CDMA systems16. Name a.pdfFashionColZone
7. What do we mean by “spreading signal”in CDMA systems?
16. Name available channels in CDMA for both forward and reverse links.
Solution
7)
In CDMA systems the entire users spread in the same bandwidth at the same time.
Communication system follow these concept are spread spectrum system. In this transmission
procedure, the frequency range of a data signal is spread use a code uncorrelated with to signal.
16)
Forward link:
To make the signal, data since the entity channels is multiply with the Walsh codes to present the
being forward link channel. The output since this procedure is further multiply with the small PN
code. This provide a means of identify the sector OR cell from which the signal is come for the
handset or mobile
Reverse link:
This channel is use by the mobile phone to communicate among the base location while no
traffic channels have been put up. This channel is hence use for gaining access to the association,
call initiation requests and too for transfer responses to page commands that may be sending by
the network..
You will write a multi-interface version of the well-known concentra.pdfFashionColZone
You will write a multi-interface version of the well-known concentration game: 1. The game
displays a grid of upper-case letters, with each letter appearing twice. 2. A player has a few
seconds to memorize the letters before they disappear. 3. The player then has to remember where
each pair was located.
line, then MultiConcentration starts with the text interface.
First the new game display will show the user the pairs he/she must guess, in a format similar to
the following example for size = 6
D H B C M I
H G K K A R
C N R E O E
Q O A Q L F
L F J P B G
P D N M I J
Memorize the above grid!
Note that the new game display uses pairs of distinct single uppercase capital letters distributed
at random on a square grid, starting at A and continuing until the grid is full.
This new game display shows for 10 seconds, after which it scrolls out of view. (To scroll it just
write about 25 newlines.) Then the standard game display appears.
The standard game display will look like the following example for size = 6
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
21 32 33 34 35 36
Enter a pair of numbers, or \"R\" to reset, or \"Q\" to quit:
reset, or \"Q\" to quit:
If the player makes an invalid entry (e.g. numbers out of range, number already guessed, no
blank separator, etc.) then a \"please reenter\" message is printed and the same display is shown
again.
If the player makes a bad guess, then a \"Sorry...\" message is printed and the same display is
shown again.
If the player enters an \"R\" for reset, then we start over, that is, the computer calculates a new
set of pairs and shows the new game display again.
If the player enters a \"Q\" for quit, then the game prints a \"Game Over\" message and ends.
3.4 Graphic Game Interface
If the player used the \"-g\" flag on the startup command line then MultiConcentration starts up
with the graphic interface.
You may design the graphic interface as you choose, as long as you use Swing and preserve the
steps in the game as described in the previous section.
One possible graphic interface is shown in Figure 1. In this design the new game display and the
standard game display have been replaced by a grid of buttons. Instead of entering pairs of
numbers, the player clicks on two of the buttons. The \"reset\" and \"quit\" commands are given
using a menu. Letters that have been correctly guessed are shown with a pink background color.
Messages to the player are shown in a text area under the grid.
4 GENERAL REQUIREMENTS
4.1 Design Requirements
Design your program with GUI classes, a main class, and Application Logic / Data classes as
described in my overheads on Design for Testability.
Do not use a package statement; name the main class MultiConcentration. (Otherwise the
startup command given in 3.1 would not work.)
You should have at least 5 classes, and not one of them should have more than 40% of the code.
Solution
import java.io.OutputStream;
import java.io.PrintStream;
public cl.
You are interested in using the plasmid pGEE as a vector for incorpor.pdfFashionColZone
You are interested in using the plasmid pGEE as a vector for incorporating foreign DNA into E.
coli where it can be cloned. The following plasmid map shows the locations of the recognition
sequence (cut) sites of five different restriction endonucleases, as well as the ORI and a
kanamycin-resistance gene (kan\'). Pick which pair of restriction endonucleases you would use to
digest the plasmid and the foreign DNA. Note: two combinations are equally good. Find them
both.
Solution
BgII and again using BgII would be a suitable choice because two BgII sites are one after the
other and that would cut a considrable amount of vector DNA, and allow foreign DNA to be
inserted. Making two incisions are necessary for foreign DNA to br inserted..
Why animals migrate I need 5 new ideas (exclude reproduction , s.pdfFashionColZone
Why animals migrate ? I need 5 new ideas (exclude : reproduction , seasons/cycle , gene flow ,
climate change and circumstantial)
Solution
Animals migrate in search of food, strength of selection, fecundity, interspecific competition, and
will adapting themselves depend upon phenotypic variation. Some animals migrate for more
livable conditions. They also move to find a place to hibernate. Migration is a behavioral
adaptation, it helps animals survive over time..
Which of the following characteristics of the fetus distinguishes it.pdfFashionColZone
Which of the following characteristics of the fetus distinguishes it from the embryo? Select one:
a. Blood cells form and fill primitive blood vessels.
b. The primitive streak appears.
c. Bone replaces the softer cartilage.
d. The specialization of one group of cells causes adjacent groups of cells to specialize.
Solution
D. The specialization of one group of cells causes adjacent groups of cells to specialize.
this is called differentiation of cells.
What are the major sources of cash (inflows) in a statement of cash .pdfFashionColZone
What are the major sources of cash (inflows) in a statement of cash flows? What are the major
uses (outflows) of cash?
Solution
While preparing a cash flow statement, the cash flows were bifurcated into 3 types. The
following are the 3 types of cash flows:
Major Sources of Cash Flows (Inflows) in a Cash Flow Statement:
1.Major Cash Inflows from Operating Activities:
2.Major Cash Inflows from Investing Activities:
3.Major Cash Inflows from Financing Activities:
Major Sources of Cash Flows (Inflows) in a Cash Flow Statement:
1.Major Cash Outflows from Operating Activities:
2.Major Cash Outflows from Investing Activities:
3. Major Cash Outflows from Financing Activities:
The above mentioned were the major sources and uses of cash flows in a statement of cash
flows..
TYPES OF AUDIT1. Is there an internal audit function within your o.pdfFashionColZone
TYPES OF AUDIT
1. Is there an internal audit function within your organisation? What is its role and how
do you view it?
2. Is there an external auditor for your organisation? What functions does the auditor
carry out and how do you view it?
Solution
Is there an internal audit function within your organisation? What is its role and how do you
view it?
ANSWER: YES, my organisation has an internal audit function. My company is small; and a
small business simply cannot afford employee fraud, government fine or a waste. Thus,
establishment of an internal audit function provides a vital step in the growth of a small
organisation. It\'role ncludes reviewing, assessment, and reporting the condition of the internal
controls in a company thus is beneficial in improvement and maintenance of the internal controls
in the company. It targets to reduce the opportunity for the fraudster, and also the management
will have no or little opportunity to conduct fraud in the company. Moreover is helpful in
findings the weaknesses and giving recommendations for the improvement in the internal
controls.
In my views internal audit function is important to my organisation as protect and enhance
organisational value by providing risk-based and objective assurance, insight and advice..
The total exergy is an extensive property of a system. True or False.pdfFashionColZone
The total exergy is an extensive property of a system. True or False? Explain.
Solution
True, Total exergy is an extensive property.
Exergy is the energy that is available to be used, it can be transferred like energy or entropy
It is depending on the total size of system, (i.e is mass of system),( not for specific size)
That’s way we called as the extensive property.
1.Define culture. How can culture be conceptionalized Your resp.pdfFashionColZone
1.Define culture. How can culture be conceptionalized?
Your response should be at least 200 words in length. You are required to use at least your
textbook as source material for your response. All sources used, including the textbook, must be
referenced; paraphrased and quoted material must have accompanying citations.
2. Discuss two HR activities in which a multinational firm must engage, which would not be
required in a domestic environment?
Your response should be at least 200 words in length. You are required to use at least your
textbook as source material for your response. All sources used, including the textbook, must be
referenced; paraphrased and quoted material must have accompanying citations.
Solution
1.
There are no definitions which describe the term culture exactly/precisely. Most cases are
accompanied by stereotypes which probably describe a country’s or group’s culture roughly
(best). Alike stereotypes of course just reflect the basics of a culture which might also not always
suit/fit. During the process of adapting to/learning a culture’s specific (secret) niceties in most
cases we get taught and guided by people of our society which know the cultural background like
teachers, friends etc. This means learning in the way groups behave. The most important
influence do have our parents which reach us also the right moral understanding they have
learned as our cultural tradition because you are not born with an understanding of culture.
Culture varies obviously from country to country. If you talk about a nation’s culture there are
often prejudices involved. Which definition or explanation ever is chosen they have all one in
common. And that is – they are all based on personal experiences. This is definitely the best way
to proof and fine out something about a culture. Researcher are depending on firsthand
observation and experiences to understand various types culture. As well as managers, if they
want to be international competitive.
2. Activities that a human resource department must engaged to operate in an international
environment are described below:
1. International Taxation:
Expatriates are subject to international taxation, and often have both domestic and host-country
tax liabilities.
Therefore, tax equalisation policies must be designed to ensure that there is no tax incentive or
disincentive associated with any particular international assignment.
2. International Relocation and Orientation:
Involves arranging for pre-departure training; providing immigration and travel details;
providing housing, shopping, medical care, and recreation and schooling information.
Many of these factors may be a source of anxiety for the expatriate and considerable time and
attention is required to resolve potential problems successfully.
3. Administrative Services:
A multinational firm also needs to provide administrative services for expatriates in the host
countries in which it operates.
Providing administrative e services can oft.
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.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Hello, I need some assistance in writing a java program THAT MUST US.pdf
1. Hello, I need some assistance in writing a java program THAT MUST USE STACKS (LIFO).
Create a Calculator w/ GUI
Write a program that graphically displays a working calculator for simple infix expressions that
consist of: single-digit operands, the operators: +, -, *, and /, and parentheses.
Make the following assumptions:
unary operators (e.g. -2) are illegal
all operations, including division, are integer operations (and results are integers)
the input expression contains no embedded spaces and no illegal characters
the input expression is a syntactically correct infix expression
division by zero will not occur (consider how you can remove this restriction)
Create a GUI application, the calculator has a display and a keypad of 20 keys, which are
arranged as follows:
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
As the user presses keys to enter an infix expression, the corresponding characters appear in the
display. The C (Clear) key erases all input entered so far; the < (Backspace) key erases the last
character entered. When the user presses the = key, the expression is evaluated and the result
2. appended to the right end of the expression in the display window. The user can then press C and
enter another expression. If the user presses the Q (Quit) key, the calculator ceases operation and
is erased from the screen.
C
<
Q
/
7
8
9
*
4
5
6
-
1
2
3
+
0
(
)
=
Solution
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Calculator extends JFrame implements ActionListener {
JPanel[] row = new JPanel[5];
JButton[] button = new JButton[19];
String[] buttonString = {"7", "8", "9", "+",
"4", "5", "6", "-",
"1", "2", "3", "*",
3. ".", "/", "C", "",
"+/-", "=", "0"};
int[] dimW = {300,45,100,90};
int[] dimH = {35, 40};
Dimension displayDimension = new Dimension(dimW[0], dimH[0]);
Dimension regularDimension = new Dimension(dimW[1], dimH[1]);
Dimension rColumnDimension = new Dimension(dimW[2], dimH[1]);
Dimension zeroButDimension = new Dimension(dimW[3], dimH[1]);
boolean[] function = new boolean[4];
double[] temporary = {0, 0};
JTextArea display = new JTextArea(1,20);
Font font = new Font("Times new Roman", Font.BOLD, 14);
Calculator() {
super("Calculator");
setDesign();
setSize(380, 250);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
GridLayout grid = new GridLayout(5,5);
setLayout(grid);
for(int i = 0; i < 4; i++)
function[i] = false;
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
FlowLayout f2 = new FlowLayout(FlowLayout.CENTER,1,1);
for(int i = 0; i < 5; i++)
row[i] = new JPanel();
row[0].setLayout(f1);
for(int i = 1; i < 5; i++)
row[i].setLayout(f2);
for(int i = 0; i < 19; i++) {
button[i] = new JButton();
button[i].setText(buttonString[i]);