SlideShare a Scribd company logo
1 of 20
ISM3230 In-class lab 8 Spring 2019
TOPIC: Introduction to classes, attributes, methods
In Assignment 4 we kept track of student numerical scores and
equivalent letter grades. The scores were stored
in an array, and the grades were stored in a second array. The
relationship between the arrays was implicitly
based on the index: for example, it was assumed that
studentScore[3] is related to studentGrade[3] because
they both are for student number 3. In object-oriented
programming, we can make this relationship explicit by
creating an object and keeping the data together in the object's
properties. We can also include pieces of
related code in the object's methods.
TASK
Your task is to write code that will be able to create Student
objects and store the score and grade data together
in the objects as properties. The student object will also be able
to print its own data to the screen. You will also
write code for a GradingScheme class that will have the
functionality to convert any integer score to a letter
grade. Then, you will create a user-specified number of
students, generate random scores for the students, and
convert them to letter grades. Finally, you will calculate the
average score, rounded average score, and the
average letter grade that corresponds to the rounded average
score.
INSTRUCTIONS
1. Create a new class file Student in the project's source
package. Write a Student class that will allow us
to store student score and student grade in the same object. Also
write a printStudent method that will
print the student details to the screen.
a. The Student class should have these properties:
public int studentId
public int score
public char grade
b. The printStudent method will print to the screen the data
about the student object. It
should print:
Student ID: id; Score: score is grade
where id, score, and grade are the object's data properties. The
method should have the
following signature, i.e., it returns no value and it requires no
parameter:
public void printStudent()
2. Create a new class file GradingScheme in the project's source
package. This class will have the
functionality to convert an integer score to a letter grade by
using its own built-in scheme, so we can use
it to convert student scores to grades for all student objects.
a. Use the following to create the class constants:
public static final int [][] GRADING_SCHEME =
{{'F',0}, {'D',60}, {'C',70}, {'B',80}, {'A',90}};
public static final int SCHEME_LETTER=0;
public static final int SCHEME_MINIMUM=1;
b. Write a method convertScore that will take an integer as a
parameter and return its
corresponding letter grade as a char. It should have the
following signature:
public char convertScore(int score)
This method could be implemented as a if-else-if tree or more
efficiently as a loop. The method
starts with the numerical score in the score variable, and should
classify it into a letter grade
based on the GRADING_SCHEME array data. The method
needs to return a char variable.
3. In the driver, write a test case to see if the Student and the
GradingScheme code works:
a. Create a GradingScheme object and save its reference in a
variable. HINT: This is similar to
creating a Scanner object and saving it in a variable keyboard
from previous labs.
b. Create one Student object, save its reference in a variable and
set its student id and student
score properties to some test values.
c. Use the grading scheme object's conversion method to
convert the student's object score to a
grade and save it in the student object's grade property. HINT:
This can be done in one line or in
multiple steps:
i. get the student object's score
ii. pass it to the grading scheme object's method for conversion
iii. store the result of the conversion
iv. set the student object's grade to the result
d. Print out the line "Test student:" and use the student object's
printStudent method to print the
student details. Make sure that the grade matches the score.
e. For example, if the student's id is 786, and the student's score
is 78, the output should be:
4. Once you're sure the code works, comment out the printing
code.
5. Ask the user for a number of students to create.
6. Declare and dimension an array of appropriate size that will
hold student objects as its elements. HINT:
the variable type of the array elements is Student.
7. Use a loop to go through the array and do the following for
each array element:
a. create a new Student object and save its reference in the array
element for future use
b. set the Student object's id so that the students are numbered
from 1 to (number of students)
HINT: the array elements are numbered from 0 to (number of
students-1), so use the loop
counter appropriately
c. generate a random score for the student and store it in score.
Use Random class' method
nextInt(int end) to get numbers from 0 to (end-1). Make student
scores be in the range
50-100 inclusive.
d. covert the student score to a letter grade by using the
GradingScheme object's conversion
method.
e. Finally, use the student's printStudent method to print the
student details to the screen
f. Note that for steps b-e you must use the saved reference to
the student object from step a.
8. Use a loop to compute an average score of all students.
9. Use a Math's class round method to round the average score
to a whole number. HINT: This method
takes a double as a parameter and returns a long. Cast the long
to an int to save the rounded value in an
int variable.
10. Use the grading scheme object's conversion method to get
an average letter grade from the rounded
average score.
11. Print the average score, rounded average score, and average
grade to the screen, see Sample output.
SUBMITTING: You will need to submit multiple files for this
Lab.
submission method, submitting the driver,
Student, and GradingScheme files
Or, Use File>Export Project>To Zip... from the main menu
bar to submit the whole project zip file.
SAMPLE OUTPUT
Note: This output is based on randomly generated values. Your
output will vary.
Economics 103 Your
Name(s):__________________________________________
Professor Friedman Your
TA:____________________________________________
Fall 2019 Your Section Time and
Day:_____________________________
Problem Set 1
Due Date: October 21 by 4PM
Hand in hard copy to your TA’s mailbox, 1st floor of Gordon
Hall
Do not submit answers on line through Moodle
Note that there are two types of problems. You are encouraged
to work with someone else in your TA section on the
quantitative problems (1, 2, 3, 4); hand in one set of answers to
this problems with both your names. Do the essay questions
individually (5 and 6) and append separate answers with each
person’s name for this along with your group answers to the
quantitative questions. Type your answers; hand-written
answers will be accepted only by special arrangement. Staple
pages together. Be sure to keep a copy of your answers just in
case.
This problem set is so much easier to do using a computer
spreadsheet that I am tempted to require that you use a
spreadsheet.
Total 20 points.
(3 points) Made the right way steamed mussels is delicious.
Your friend Rihanna has abandoned her music career to open a
bistro, which specializes in French cuisine and,
includingmussels. She has done some market research and finds
that your neighbors valuemusselsaccording to the following
schedule:
serving
MU mussels
1
$32.00
2
$29.76
3
$27.68
4
$25.54
5
$23.75
6
$22.09
7
$20.54
8
$19.11
9
$17.77
10
$16.52
(1 points) Graph the demand curve for mussels. Does the
demand curve have a positive or negative slope? Why?
The demand curve has a negative slope, because the MU
mussels is diminishing.
(1 point) How many servings will Rihanna sell at $32? How
many at $25.54? At $17.77?
Rihanna will sell 1 serving at $32, 4 servings at $25.54 and 9
servings at $17.77.
(1 point) What will happen to the demand curve if a new study
comes out showing shellfish and onions (ingredients
inRihanna’s mussels) increase the risk of cancer? What will
happen to the demand curve if instead a study comes out
showing they reduce the risk of heart disease?
If a new study comes out showing shellfish and onions increase
the risk of cancer, the demand curve will shift to the left since
they are bad for people, so there is a lower demand of this good.
If a study comes out showing they reduce the risk of heart
disease, the demand curve will shift right since they are good
for people’s health.
(3 points) Production. Rihanna using equipment that she rents
for $150 and ingredients that cost $6.96 a serving for the first 5
servings; for additional servings, she can buy the ingredients at
a discount for $6.00. (Note that she signed a lease and pays the
rent regardless of how many dinners she serves; note that
regardless of how much ingredients she buys for additional
servings, she pays $6.96 for the ingredients for the first 5.) She
hires workers at $20 each and finds that they produce servings
according to the following schedule:
(1 points) Calculate and and graph the marginal cost of each
serving. (Use a spreadsheet and show your calculations!) Why
does the MC curve have the slope (up, down, or flat) that it
does? What happens to the slope of the MC curve as Ella
produces more and more servings? Why?
Servings
Total Workers
Marginal wage
Variable
MC
1
0.40
0.40*20=8
$ 6.96
6.96+8=14.96
2
0.86
0.86*20=17.2
$ 6.96
6.96+17.2=24.16
3
1.39
1.39*20=27.8
$ 6.96
6.96+27.8=34.76
4
2.00
2.00*20=40
$ 6.96
6.96+40=46.96
5
2.70
2.70*20=54
$ 6.96
6.96+54=60.96
6
3.50
3.50*20=70
$ 6.00
6+70=76
7
4.43
4.43*20=88.6
$ 6.00
6+88.6=94.6
8
5.49
5.49*20=109.8
$ 6.00
6+109.8=115.8
9
6.71
6.71*20=134.2
$ 6.00
6+134.2=140.2
10
8.12
8.12*20=162.4
$ 6.00
6+162.4=168.4
The MC curve has a positive slope, because the marginal
productivity is reducing, the additional output needs more
workers to do it. The slope of the MC curve will go up as more
and more servings she produces, since the workers she needs are
getting more and more (the marginal workers is higher and
higher).
(2 points) Calculate and graph the marginal cost of each serving
if workers get a raise to $30/hour, with the old productivity.
What happens if they also become more productive so each
serving can be made with only two thirds as much labor. Show
your calculations! Compare the results of high wages and high
productivity with the initial situation. Which would you prefer
as an employer? Which would you prefer as worker? Which is
better for society?
I would prefer higher productivity as an employer, prefer low
wages as worker. Higher productivity is better for society.
(4 points) Perfect competition and equilibrium. (please answer
correctly and completely)
(1 point) Put the demand and supply curves together (at the
original productivity and wages). Rihanna is a musician and
never took Economics, so she naively assumes that she is in a
perfectly competitive market. How many servings will she sell?
At what price?
Rihanna will sell 6 servings at the price 70, since at the point,
MC is close to MU.
(1 point) Draw the graph again and shade in the entire area of
consumer surplus. Shade in the entire area of producer surplus.
(2 points) Calculate consumer surplus as the sum of the
difference between the marginal utility and the price for each
serving up to the last sold. Calculate producer surplus as the
sum of the difference between price and marginal cost for each
serving. What is the dollar value of consumer surplus? What is
the dollar value of the producer surplus? What is the dollar
value of the total social surplus?
Servings
MC
price
producer Surplus
1
$ 14.56
$ 18.06
$ 3.50
2
$ 15.31
$ 18.06
$ 2.75
3
$ 16.06
$ 18.06
$ 1.98
4
$ 17.06
$ 18.06
$ 1.00
5
$ 18.06
$ 18.06
$ -
Total
$ 9.23
4
$ 19.69
$ 18.06
$ 1.63
5
$ 18.04
$ 18.06
$ 0.02
Total
$ 21.60
(4 points) Monopoly and equilibrium
(1 point) Ella gets smart and realizes that she is the only quality
bistro around. Calculate the marginal revenue she gets for each
additional serving as the change in total revenue (price times
sales). Graph this. What is the new quantity of sales and the
new price?
Servings
MC supply
MU demand
MR
1
14.56
27.5
27.5
2
15.31
24.75
22
3
16.06
21.88
16.14
4
17.06
19.69
13.12
5
18.06
18.04
11.44
6
19.06
16.24
7.24
7
20.31
14.61
4.83
8
21.56
13.15
2.93
9
23.06
11.84
1.36
10
24.81
10.65
0.06
1
26.56
9.59
1.01
12
28.56
8.63
1.93
13
30.56
7.77
2.55
14
33.06
6.99
3.15
(1 point) Shade in the entire area of consumer surplus on your
monopoly graph. Shade in the entire area of producer surplus.
(1 point) Calculate total consumer and total producer surplus
under the monopoly
situation. What is the dollar value of each, and of total social
surplus?
serving
MC
PRICE
Producer surplus
1
$ 27.50
$ 21.88
$ 5.62
2
$ 24.75
$ 21.88
$ 2.87
3
$ 21.88
$ 21.88
$ -
total
$ 8.49
1
$ 14.36
$ 21.88
$ 7.32
2
$ 15.31
$ 21.88
$ 6.57
3
$ 16.06
$ 21.88
$ 5.82
total
$ 19.71
(1 point) Compare the sum of consumer and producer surplus
for the monopoly with the results for perfect competition.
Which is better for consumers? Which is better for producers?
Which is better for society? Explain.
It is better for consumers to have perfect competition because
they will have more surplus in that market. The producers have
more surplus in monopolies rather than in perfect competition
so it is more beneficial for producers to have monopolies.it is
better for societies to have perfect competition because the total
surplus is larger which means the society will have more
surplus which will be better for everyone.
(2 points) Moving Equilibrium. Show the effect of each on the
monopoly market equilibrium; you don’t need to have exact
answers but explain the direction of change in the demand
and/or marginal cost curves.
(0.5 points) beef prices rise so people want shellfish.
If beef prices rise, MC would goes up which can make the
monopolists to sell with higher prices. And when P=MC, they
would like to sell. They would produce less.
(0.5 points) there is an economic recession and income falls
There will be a decrease in demand, and the demand curve
would shift left, since the demand for goods is affected by
people’s income. The lower income is, the lower demand is.
(0.5 points) poor conditions reduce the mussels catch
The marginal cost curve shifts left. It is because the poor
condition limit the supply. The supply decrease and demand
maintain will cause the marginal cost curve shift to the left.
(0.5 points) economic recession, lower wages and lower
income.
There will be a decrease in demand, and the demand curve
would shift left, since the demand for goods is affected by
people’s income. The lower income is, the lower demand is.
(4 points) Can consumers change companies? Clothing prices in
the United States have been falling for decades. We now import
most of our clothing from countries where wages are low and
workers labor in unsafe conditions. (In 2013, for example, the
Rana Plaza in Bangladesh collapsed killing over 1000 workers,
mostly young women, who worked for low wages making
clothes for US retailers, including Ivanka Trump.)
Review chapter 3.4 in Real-World Micro, “campus struggles
against sweatshops continue.” Do you think that most people
want to buy clothes made in unsafe workplaces by poorly paid
workers? Why do companies produce under those conditions?
There are companies, such as Patagonia and Eileen Fisher, who
offer “fair trade” clothing manufactured in unsafe workplaces
by workers paid a decent wage. But these companies are
swimming against the tide and occupied very small share of the
market. Why haven’t they been more successful?
I don’t think most people want to buy clothes made in unsafe
workplaces by poorly paid workers. Clothing production
pollution is serious, only the economically underdeveloped
areas can be mass production of clothing. But low-income
people need clothes at a lower price. If production facilities go
up and wages go up, the cost of clothing goes up and the price
of clothing goes up. The capitalist thinks the profit is supreme,
only the cost is low can obtain the bigger profit. Patagonia and
Eileen Fisher, these two companies, pay the workers decent
wage. The higher the wage is, the higher the cost is and the
profit become less. Therefore, they haven’t been successful.
Dean’s Beans is a local Amherst business who sources coffee
from poor farmers in the Third World. How is Dean able to pay
farmers higher prices for their coffee? Is his business a charity,
or can he run it as a profitable capitalist business? (I suggest
you follow the links to learn more about Dean’s Beans!)
Dean by building a long-term relationship with farmers for fair
trade, so Dean pay farmers higher pieces for their coffee. In this
way, farmers show loyalty to Dean, which make the supply
chain stable, the quality of products enables them to offer
higher prices. He run it as profitable capitalist business.
Why do you think there are more options for fair trade coffee
then for clothing?
Coffee and clothing are two different commodities. Coffee is an
agricultural and reprocessed product. Clothing is a labor-
intensive product, which requires many people, so the cost of
clothing industry accounts for a large proportion.
1

More Related Content

Similar to ISM3230 Introduction to classes, attributes, methods

INF 103(ASH) Possible Is Everything/newtonhelp.com
INF 103(ASH) Possible Is Everything/newtonhelp.comINF 103(ASH) Possible Is Everything/newtonhelp.com
INF 103(ASH) Possible Is Everything/newtonhelp.comlechenau71
 
INF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.comINF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.comlechenau48
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docxmercysuttle
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlpankit_ppt
 
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxDIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxlynettearnold46882
 
JAVA practical Exam Questions (1).docx
JAVA practical Exam Questions (1).docxJAVA practical Exam Questions (1).docx
JAVA practical Exam Questions (1).docxLucky Ally
 
1 P a g e ME 350 Project 2 Posted February 26.docx
1  P a g e   ME 350 Project 2  Posted February 26.docx1  P a g e   ME 350 Project 2  Posted February 26.docx
1 P a g e ME 350 Project 2 Posted February 26.docxoswald1horne84988
 
For this Applied Knowledge Assessment, you will use the concepts.docx
For this Applied Knowledge Assessment, you will use the concepts.docxFor this Applied Knowledge Assessment, you will use the concepts.docx
For this Applied Knowledge Assessment, you will use the concepts.docxAKHIL969626
 
MISY 3331 Advanced Database ConceptsAssignment 3Dr. Sotirios .docx
MISY 3331 Advanced Database ConceptsAssignment 3Dr.  Sotirios .docxMISY 3331 Advanced Database ConceptsAssignment 3Dr.  Sotirios .docx
MISY 3331 Advanced Database ConceptsAssignment 3Dr. Sotirios .docxaltheaboyer
 
Class tech courseware
Class tech coursewareClass tech courseware
Class tech coursewaresr3woodall
 
Since the instructions for the final project are standardized and .docx
Since the instructions for the final project are standardized and .docxSince the instructions for the final project are standardized and .docx
Since the instructions for the final project are standardized and .docxedgar6wallace88877
 

Similar to ISM3230 Introduction to classes, attributes, methods (13)

INF 103(ASH) Possible Is Everything/newtonhelp.com
INF 103(ASH) Possible Is Everything/newtonhelp.comINF 103(ASH) Possible Is Everything/newtonhelp.com
INF 103(ASH) Possible Is Everything/newtonhelp.com
 
INF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.comINF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.com
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxDIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
 
JAVA practical Exam Questions (1).docx
JAVA practical Exam Questions (1).docxJAVA practical Exam Questions (1).docx
JAVA practical Exam Questions (1).docx
 
1 P a g e ME 350 Project 2 Posted February 26.docx
1  P a g e   ME 350 Project 2  Posted February 26.docx1  P a g e   ME 350 Project 2  Posted February 26.docx
1 P a g e ME 350 Project 2 Posted February 26.docx
 
Ex
ExEx
Ex
 
For this Applied Knowledge Assessment, you will use the concepts.docx
For this Applied Knowledge Assessment, you will use the concepts.docxFor this Applied Knowledge Assessment, you will use the concepts.docx
For this Applied Knowledge Assessment, you will use the concepts.docx
 
MISY 3331 Advanced Database ConceptsAssignment 3Dr. Sotirios .docx
MISY 3331 Advanced Database ConceptsAssignment 3Dr.  Sotirios .docxMISY 3331 Advanced Database ConceptsAssignment 3Dr.  Sotirios .docx
MISY 3331 Advanced Database ConceptsAssignment 3Dr. Sotirios .docx
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
 
Class tech courseware
Class tech coursewareClass tech courseware
Class tech courseware
 
Since the instructions for the final project are standardized and .docx
Since the instructions for the final project are standardized and .docxSince the instructions for the final project are standardized and .docx
Since the instructions for the final project are standardized and .docx
 

More from vrickens

1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docx1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docxvrickens
 
1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docxvrickens
 
1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docx1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docxvrickens
 
10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docxvrickens
 
100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docxvrickens
 
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docxvrickens
 
1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docx1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docxvrickens
 
100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docx100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docxvrickens
 
100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docxvrickens
 
100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docxvrickens
 
100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docxvrickens
 
100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docxvrickens
 
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docxvrickens
 
100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docxvrickens
 
100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docxvrickens
 
100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docx100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docxvrickens
 
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docxvrickens
 
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docxvrickens
 
10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docx10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docxvrickens
 
10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docx10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docxvrickens
 

More from vrickens (20)

1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docx1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docx
 
1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx
 
1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docx1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docx
 
10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx
 
100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx
 
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
 
1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docx1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docx
 
100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docx100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docx
 
100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx
 
100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx
 
100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx
 
100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx
 
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
 
100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx
 
100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx
 
100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docx100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docx
 
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
 
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
 
10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docx10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docx
 
10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docx10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docx
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 

ISM3230 Introduction to classes, attributes, methods

  • 1. ISM3230 In-class lab 8 Spring 2019 TOPIC: Introduction to classes, attributes, methods In Assignment 4 we kept track of student numerical scores and equivalent letter grades. The scores were stored in an array, and the grades were stored in a second array. The relationship between the arrays was implicitly based on the index: for example, it was assumed that studentScore[3] is related to studentGrade[3] because they both are for student number 3. In object-oriented programming, we can make this relationship explicit by creating an object and keeping the data together in the object's properties. We can also include pieces of related code in the object's methods. TASK Your task is to write code that will be able to create Student objects and store the score and grade data together in the objects as properties. The student object will also be able to print its own data to the screen. You will also write code for a GradingScheme class that will have the functionality to convert any integer score to a letter
  • 2. grade. Then, you will create a user-specified number of students, generate random scores for the students, and convert them to letter grades. Finally, you will calculate the average score, rounded average score, and the average letter grade that corresponds to the rounded average score. INSTRUCTIONS 1. Create a new class file Student in the project's source package. Write a Student class that will allow us to store student score and student grade in the same object. Also write a printStudent method that will print the student details to the screen. a. The Student class should have these properties: public int studentId public int score public char grade b. The printStudent method will print to the screen the data about the student object. It should print: Student ID: id; Score: score is grade
  • 3. where id, score, and grade are the object's data properties. The method should have the following signature, i.e., it returns no value and it requires no parameter: public void printStudent() 2. Create a new class file GradingScheme in the project's source package. This class will have the functionality to convert an integer score to a letter grade by using its own built-in scheme, so we can use it to convert student scores to grades for all student objects. a. Use the following to create the class constants: public static final int [][] GRADING_SCHEME = {{'F',0}, {'D',60}, {'C',70}, {'B',80}, {'A',90}}; public static final int SCHEME_LETTER=0; public static final int SCHEME_MINIMUM=1; b. Write a method convertScore that will take an integer as a parameter and return its corresponding letter grade as a char. It should have the following signature: public char convertScore(int score)
  • 4. This method could be implemented as a if-else-if tree or more efficiently as a loop. The method starts with the numerical score in the score variable, and should classify it into a letter grade based on the GRADING_SCHEME array data. The method needs to return a char variable. 3. In the driver, write a test case to see if the Student and the GradingScheme code works: a. Create a GradingScheme object and save its reference in a variable. HINT: This is similar to creating a Scanner object and saving it in a variable keyboard from previous labs. b. Create one Student object, save its reference in a variable and set its student id and student score properties to some test values. c. Use the grading scheme object's conversion method to convert the student's object score to a grade and save it in the student object's grade property. HINT: This can be done in one line or in multiple steps: i. get the student object's score
  • 5. ii. pass it to the grading scheme object's method for conversion iii. store the result of the conversion iv. set the student object's grade to the result d. Print out the line "Test student:" and use the student object's printStudent method to print the student details. Make sure that the grade matches the score. e. For example, if the student's id is 786, and the student's score is 78, the output should be: 4. Once you're sure the code works, comment out the printing code. 5. Ask the user for a number of students to create. 6. Declare and dimension an array of appropriate size that will hold student objects as its elements. HINT: the variable type of the array elements is Student. 7. Use a loop to go through the array and do the following for each array element: a. create a new Student object and save its reference in the array element for future use b. set the Student object's id so that the students are numbered from 1 to (number of students) HINT: the array elements are numbered from 0 to (number of students-1), so use the loop
  • 6. counter appropriately c. generate a random score for the student and store it in score. Use Random class' method nextInt(int end) to get numbers from 0 to (end-1). Make student scores be in the range 50-100 inclusive. d. covert the student score to a letter grade by using the GradingScheme object's conversion method. e. Finally, use the student's printStudent method to print the student details to the screen f. Note that for steps b-e you must use the saved reference to the student object from step a. 8. Use a loop to compute an average score of all students. 9. Use a Math's class round method to round the average score to a whole number. HINT: This method takes a double as a parameter and returns a long. Cast the long to an int to save the rounded value in an int variable. 10. Use the grading scheme object's conversion method to get an average letter grade from the rounded
  • 7. average score. 11. Print the average score, rounded average score, and average grade to the screen, see Sample output. SUBMITTING: You will need to submit multiple files for this Lab. submission method, submitting the driver, Student, and GradingScheme files Or, Use File>Export Project>To Zip... from the main menu bar to submit the whole project zip file. SAMPLE OUTPUT Note: This output is based on randomly generated values. Your output will vary.
  • 8. Economics 103 Your Name(s):__________________________________________ Professor Friedman Your TA:____________________________________________ Fall 2019 Your Section Time and Day:_____________________________ Problem Set 1 Due Date: October 21 by 4PM Hand in hard copy to your TA’s mailbox, 1st floor of Gordon Hall Do not submit answers on line through Moodle Note that there are two types of problems. You are encouraged to work with someone else in your TA section on the quantitative problems (1, 2, 3, 4); hand in one set of answers to this problems with both your names. Do the essay questions individually (5 and 6) and append separate answers with each person’s name for this along with your group answers to the quantitative questions. Type your answers; hand-written answers will be accepted only by special arrangement. Staple pages together. Be sure to keep a copy of your answers just in case. This problem set is so much easier to do using a computer spreadsheet that I am tempted to require that you use a spreadsheet. Total 20 points. (3 points) Made the right way steamed mussels is delicious. Your friend Rihanna has abandoned her music career to open a bistro, which specializes in French cuisine and, includingmussels. She has done some market research and finds that your neighbors valuemusselsaccording to the following
  • 9. schedule: serving MU mussels 1 $32.00 2 $29.76 3 $27.68 4 $25.54 5 $23.75 6 $22.09 7 $20.54 8 $19.11 9 $17.77 10 $16.52 (1 points) Graph the demand curve for mussels. Does the demand curve have a positive or negative slope? Why? The demand curve has a negative slope, because the MU mussels is diminishing. (1 point) How many servings will Rihanna sell at $32? How
  • 10. many at $25.54? At $17.77? Rihanna will sell 1 serving at $32, 4 servings at $25.54 and 9 servings at $17.77. (1 point) What will happen to the demand curve if a new study comes out showing shellfish and onions (ingredients inRihanna’s mussels) increase the risk of cancer? What will happen to the demand curve if instead a study comes out showing they reduce the risk of heart disease? If a new study comes out showing shellfish and onions increase the risk of cancer, the demand curve will shift to the left since they are bad for people, so there is a lower demand of this good. If a study comes out showing they reduce the risk of heart disease, the demand curve will shift right since they are good for people’s health. (3 points) Production. Rihanna using equipment that she rents for $150 and ingredients that cost $6.96 a serving for the first 5 servings; for additional servings, she can buy the ingredients at a discount for $6.00. (Note that she signed a lease and pays the rent regardless of how many dinners she serves; note that regardless of how much ingredients she buys for additional servings, she pays $6.96 for the ingredients for the first 5.) She hires workers at $20 each and finds that they produce servings according to the following schedule: (1 points) Calculate and and graph the marginal cost of each serving. (Use a spreadsheet and show your calculations!) Why does the MC curve have the slope (up, down, or flat) that it does? What happens to the slope of the MC curve as Ella produces more and more servings? Why? Servings
  • 11. Total Workers Marginal wage Variable MC 1 0.40 0.40*20=8 $ 6.96 6.96+8=14.96 2 0.86 0.86*20=17.2 $ 6.96 6.96+17.2=24.16 3 1.39 1.39*20=27.8 $ 6.96 6.96+27.8=34.76 4 2.00 2.00*20=40 $ 6.96 6.96+40=46.96 5 2.70 2.70*20=54 $ 6.96 6.96+54=60.96 6 3.50 3.50*20=70 $ 6.00 6+70=76 7 4.43
  • 12. 4.43*20=88.6 $ 6.00 6+88.6=94.6 8 5.49 5.49*20=109.8 $ 6.00 6+109.8=115.8 9 6.71 6.71*20=134.2 $ 6.00 6+134.2=140.2 10 8.12 8.12*20=162.4 $ 6.00 6+162.4=168.4 The MC curve has a positive slope, because the marginal productivity is reducing, the additional output needs more workers to do it. The slope of the MC curve will go up as more and more servings she produces, since the workers she needs are getting more and more (the marginal workers is higher and higher). (2 points) Calculate and graph the marginal cost of each serving if workers get a raise to $30/hour, with the old productivity. What happens if they also become more productive so each serving can be made with only two thirds as much labor. Show your calculations! Compare the results of high wages and high productivity with the initial situation. Which would you prefer as an employer? Which would you prefer as worker? Which is better for society?
  • 13. I would prefer higher productivity as an employer, prefer low wages as worker. Higher productivity is better for society. (4 points) Perfect competition and equilibrium. (please answer correctly and completely) (1 point) Put the demand and supply curves together (at the original productivity and wages). Rihanna is a musician and never took Economics, so she naively assumes that she is in a perfectly competitive market. How many servings will she sell? At what price? Rihanna will sell 6 servings at the price 70, since at the point, MC is close to MU. (1 point) Draw the graph again and shade in the entire area of consumer surplus. Shade in the entire area of producer surplus. (2 points) Calculate consumer surplus as the sum of the difference between the marginal utility and the price for each serving up to the last sold. Calculate producer surplus as the sum of the difference between price and marginal cost for each serving. What is the dollar value of consumer surplus? What is the dollar value of the producer surplus? What is the dollar value of the total social surplus? Servings MC price producer Surplus 1 $ 14.56 $ 18.06 $ 3.50 2 $ 15.31
  • 14. $ 18.06 $ 2.75 3 $ 16.06 $ 18.06 $ 1.98 4 $ 17.06 $ 18.06 $ 1.00 5 $ 18.06 $ 18.06 $ - Total $ 9.23 4 $ 19.69 $ 18.06 $ 1.63 5 $ 18.04 $ 18.06 $ 0.02 Total $ 21.60 (4 points) Monopoly and equilibrium (1 point) Ella gets smart and realizes that she is the only quality
  • 15. bistro around. Calculate the marginal revenue she gets for each additional serving as the change in total revenue (price times sales). Graph this. What is the new quantity of sales and the new price? Servings MC supply MU demand MR 1 14.56 27.5 27.5 2 15.31 24.75 22 3 16.06 21.88 16.14 4 17.06 19.69 13.12 5 18.06 18.04 11.44 6 19.06 16.24 7.24 7 20.31
  • 17. monopoly graph. Shade in the entire area of producer surplus. (1 point) Calculate total consumer and total producer surplus under the monopoly situation. What is the dollar value of each, and of total social surplus? serving MC PRICE Producer surplus 1 $ 27.50 $ 21.88 $ 5.62 2 $ 24.75 $ 21.88 $ 2.87 3 $ 21.88 $ 21.88 $ - total $ 8.49 1 $ 14.36 $ 21.88 $ 7.32 2 $ 15.31
  • 18. $ 21.88 $ 6.57 3 $ 16.06 $ 21.88 $ 5.82 total $ 19.71 (1 point) Compare the sum of consumer and producer surplus for the monopoly with the results for perfect competition. Which is better for consumers? Which is better for producers? Which is better for society? Explain. It is better for consumers to have perfect competition because they will have more surplus in that market. The producers have more surplus in monopolies rather than in perfect competition so it is more beneficial for producers to have monopolies.it is better for societies to have perfect competition because the total surplus is larger which means the society will have more surplus which will be better for everyone. (2 points) Moving Equilibrium. Show the effect of each on the monopoly market equilibrium; you don’t need to have exact answers but explain the direction of change in the demand and/or marginal cost curves. (0.5 points) beef prices rise so people want shellfish. If beef prices rise, MC would goes up which can make the monopolists to sell with higher prices. And when P=MC, they would like to sell. They would produce less. (0.5 points) there is an economic recession and income falls There will be a decrease in demand, and the demand curve would shift left, since the demand for goods is affected by
  • 19. people’s income. The lower income is, the lower demand is. (0.5 points) poor conditions reduce the mussels catch The marginal cost curve shifts left. It is because the poor condition limit the supply. The supply decrease and demand maintain will cause the marginal cost curve shift to the left. (0.5 points) economic recession, lower wages and lower income. There will be a decrease in demand, and the demand curve would shift left, since the demand for goods is affected by people’s income. The lower income is, the lower demand is. (4 points) Can consumers change companies? Clothing prices in the United States have been falling for decades. We now import most of our clothing from countries where wages are low and workers labor in unsafe conditions. (In 2013, for example, the Rana Plaza in Bangladesh collapsed killing over 1000 workers, mostly young women, who worked for low wages making clothes for US retailers, including Ivanka Trump.) Review chapter 3.4 in Real-World Micro, “campus struggles against sweatshops continue.” Do you think that most people want to buy clothes made in unsafe workplaces by poorly paid workers? Why do companies produce under those conditions? There are companies, such as Patagonia and Eileen Fisher, who offer “fair trade” clothing manufactured in unsafe workplaces by workers paid a decent wage. But these companies are swimming against the tide and occupied very small share of the market. Why haven’t they been more successful? I don’t think most people want to buy clothes made in unsafe workplaces by poorly paid workers. Clothing production pollution is serious, only the economically underdeveloped areas can be mass production of clothing. But low-income people need clothes at a lower price. If production facilities go up and wages go up, the cost of clothing goes up and the price of clothing goes up. The capitalist thinks the profit is supreme, only the cost is low can obtain the bigger profit. Patagonia and Eileen Fisher, these two companies, pay the workers decent
  • 20. wage. The higher the wage is, the higher the cost is and the profit become less. Therefore, they haven’t been successful. Dean’s Beans is a local Amherst business who sources coffee from poor farmers in the Third World. How is Dean able to pay farmers higher prices for their coffee? Is his business a charity, or can he run it as a profitable capitalist business? (I suggest you follow the links to learn more about Dean’s Beans!) Dean by building a long-term relationship with farmers for fair trade, so Dean pay farmers higher pieces for their coffee. In this way, farmers show loyalty to Dean, which make the supply chain stable, the quality of products enables them to offer higher prices. He run it as profitable capitalist business. Why do you think there are more options for fair trade coffee then for clothing? Coffee and clothing are two different commodities. Coffee is an agricultural and reprocessed product. Clothing is a labor- intensive product, which requires many people, so the cost of clothing industry accounts for a large proportion. 1