1. [10] Draw a UML class diagram for the following class definitions.
class A{
};
class B{
public:
virtual int myfunc();
protected:
int x_;
private:
A* a_;
};
class C: public B{
public:
int myfunc();
};
2. [15] Provide code for the instance() function for one the
implementations and explain the operation of this function.
3. [10] Given following code in main()
A *p = new B;
p->myfunc():
Complete below class definitions such that myfunc() invoked
above is a feature of class B. Explain your code.
class A{
};
class B: public A{
};
4. [15] Given the code below, provide definition
of the Adapter class for the class-based Adapter design
pattern:state class inheritance and provide myFunc() implementation
in terms of yourFunc(), the implementation is of your
choice. Provide example of client usage of your pattern (invocation
of the implemented function).
class TargetInterface{
public:
void myFunc();
};
class Adaptee{
public:
void yourFunc();
}
5. [15] Given the code below, explain the relationship between changeState in
class Context and class State. Provide outside (of class)
implementations of both functions.
class Context{
void changeState(State *s);
private:
state* s_;
};
class State{
void changeState(Context *c, State *s);
};
6. [10] Given the following abstract class, provide
a concrete implementation (define the clone() implementation) and
provide an example of use by a client.
class Prototype{
Public:
virtual Prototype* clone();
};
7. [15] Write code that decorates the below ChrsitmasTree with ornaments (modifies the
stored string). Give example code that invokes show() to print out
the decorated tree.
class ChristmasTree{
public:
ChristmasTree:tree_("_\|/_"){} // initializes the tree
virtual string show() const{return tree_;}
private:
string tree_;
};
China’s Economy
Macroeconomics presentation
Professor : Insaf Lahouel
Abdullah AlHasoon Khaled Ahmad Abdullah Hoori Abdulelah Marghalani Nabeel AlMutahar
China’s Real GDP
China’s real gross domestic product has declined from 14.2 percent in 2007 to 6.9 percent in 2017
International Monetary Fund anticipates the growth to fall to 5.7 percent by 2022
Between 1979 and 2016, the country’s real gross domestic product averaged 9.6 percent.
Nonetheless, the global economic slowdown significantly affected Chinese economy
China’s real gross domestic product has declined significantly, from 14.2 percent in 2007 to 6.9 percent in 2017, and the International Monetary Fund anticipates the growth to fall to 5.7 percent by 2022. Since the introduction of economic reform, the country’s econ.
1. [10] Draw a UML class diagram for the following class def.docx
1. 1. [10] Draw a UML class diagram for the following class
definitions.
class A{
};
class B{
public:
virtual int myfunc();
protected:
int x_;
private:
A* a_;
};
class C: public B{
2. public:
int myfunc();
};
2. [15] Provide code for the instance() function for one the
implementations and explain the operation of this function.
3. [10] Given following code in main()
A *p = new B;
p->myfunc():
Complete below class definitions such that myfunc() invoked
above is a feature of class B. Explain your code.
class A{
};
3. class B: public A{
};
4. [15] Given the code below, provide definition
of the Adapter class for the class-based Adapter design
pattern:state class inheritance and provide myFunc()
implementation
in terms of yourFunc(), the implementation is of your
choice. Provide example of client usage of your pattern
(invocation
of the implemented function).
class TargetInterface{
public:
void myFunc();
};
4. class Adaptee{
public:
void yourFunc();
}
5. [15] Given the code below, explain the relationship between
changeState in
class Context and class State. Provide outside (of class)
implementations of both functions.
class Context{
void changeState(State *s);
private:
state* s_;
};
class State{
5. void changeState(Context *c, State *s);
};
6. [10] Given the following abstract class, provide
a concrete implementation (define the clone()
implementation) and
provide an example of use by a client.
class Prototype{
Public:
virtual Prototype* clone();
};
7. [15] Write code that decorates the below ChrsitmasTree with
ornaments (modifies the
stored string). Give example code that invokes show() to print
out
the decorated tree.
6. class ChristmasTree{
public:
ChristmasTree:tree_("_|/_"){} // initializes the tree
virtual string show() const{return tree_;}
private:
string tree_;
};
China’s Economy
Macroeconomics presentation
Professor : Insaf Lahouel
Abdullah AlHasoon Khaled Ahmad Abdullah Hoori
Abdulelah Marghalani Nabeel AlMutahar
China’s Real GDP
China’s real gross domestic product has declined from 14.2
percent in 2007 to 6.9 percent in 2017
International Monetary Fund anticipates the growth to fall to
5.7 percent by 2022
7. Between 1979 and 2016, the country’s real gross domestic
product averaged 9.6 percent.
Nonetheless, the global economic slowdown significantly
affected Chinese economy
China’s real gross domestic product has declined significantly,
from 14.2 percent in 2007 to 6.9 percent in 2017, and the
International Monetary Fund anticipates the growth to fall to
5.7 percent by 2022. Since the introduction of economic reform,
the country’s economy has increased or grown faster compared
to the pre-reform era and avoided major economic disruptions
for the major part. Between 1979 and 2016, the country’s real
gross domestic product averaged 9.6 percent. This implies that
on average the country has managed to increase the size of its
real gross domestic product by more than 100 percent in 8
years. Nonetheless, the global economic slowdown, which
started in 2008, significantly affected Chinese economy
(Morrison, 2018).
2
China’s Real GDP Growth
Real GDP Growth 2007 2008 2009 2010 2011 2012 2013 2014
2015 2016 2017 2018 2019 2020 2021 2022 14.2 9.6
9.2000000000000011 10.6 9.5 7.9 7.8 7.3 6.9
6.7 6.8 6.6 6.4 6.2 6 5.8
China’s Real GDP
In 2009 at least 20 million migrant workers returned to the
country after losing their jobs
China’s real GDP for the fourth quarter of the year 2008
8. declined to 6.8 percent year on year
Between 2008 and 2010 the country’s real gross domestic
product growth averaged 9.7 percent
China’s gross domestic product slowed from 10.6 percent in
2010 to 6.7 percent in 2016
In 2017, China’s real GDP was 6.8 percent
The country’s media reported in 2009 that at least 20 million
migrant workers returned to the country after losing their jobs
due financial crisis and that the country’s real gross domestic
product for the fourth quarter of the year 2008 had declined to
6.8 percent year on year. The government responded by
implementing a 586 billion United States dollars economic
stimulus package for infrastructural develop and loosening of
monetary policies to stimulate bank lending. These policies
enabled the country to effectively weather the impacts of the
global recession in demand for the country’s products. Between
2008 and 2010 the country’s real gross domestic product growth
averaged 9.7 percent. However, the rate of the China’s gross
domestic product slowed from 10.6 percent in 2010 to 6.7
percent in 2016 before rising to 6.8 percent in 2017 (Morrison,
2018).
3
China’s Real GDP
Real GDP 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
2011 2012 2013 2014 2015 2016 2017 7.6 7.9 5.8 9
10.9 15.2 13.5 8.9 11.6 11.3 4.0999999999999996
3.8 9.2000000000000011 14.2 13.9 13.1 10.9 10
9. 9.3000000000000007 7.8 7.6 8.4
8.3000000000000007 9.1 10 10.1 11.3 12.7 14.2
9.6 9.2000000000000011 10.6 9.5 7.7 7.7 7.3
6.9 6.7 6.8
China’s Inflation
The food component has caused significant variations in the
consumer price index
Food prices are highly volatile due to their susceptibility to the
supply side shocks
Since 2012, China’s consumer price index has been in a
relatively narrow range
A reduction in food prices in early 2017 exerted a downward
pressure on inflation
China has seen variations in its consumer price index because of
the high weight of food component in the consumer price index
component as well as the inherent volatility of food prices due
to their susceptibility to the supply side shocks. Chinas’
National Bureau of Statistics publishes a monthly consumer
price index headline and indices for 8 major expenditure
categories in the consumer price index basket. These include:
food, residence, alcohol and tobacco, transport and
communication, household durables and services, clothing,
education and recreation, health as well as miscellaneous
category. Since 2012, China’s consumer price index has been in
a relatively narrow range, partly because of stable food price
inflation. The reduction in food price cyclicality has reflected
10. the structural food production changes in the country. In early
2017, a reduction in food prices due to abundant supply of
vegetables exerted a downward pressure on inflation (RBA,
2017).
4
China’s Recession and it Impact
An economic recession in China will hurt everyone
International Monetary Fund indicate that the pain will be
concentrated and confined regionally
Nonetheless, the impact of Chinese recession on the
international market would be great
A recession in China’s economy would lead to:
Shrinking of consumption and investment; and
Reduction in market valuation of firms
China’s real gross domestic product peaked at 14.2 percent in
2007 and has been decline since then. By 2017, the real gross
domestic point dropped to 6.8 percent. Typical estimates, for
instance the International Monetary Fund’s estimations of a
country risk, indicate an economic recession in China will hurt
everyone. According to the International Monetary Fund, the
acute pain will be concentrated and confined regionally unlike
the United States deep recession. Nonetheless this might not be
the case. First, the impact on the international market would be
greater than the Chinese market linkages would forecast or
suggest. Secondly investors today are more concerned about the
rising interest rates, which would lead to the shrinking of
11. consumption and investment as well as reduction of market
values of firms whose valuation are heavily anchored on the
future profit growth par. A recession in China’s economy would
worsen the situation (Rogoff, 2018).
5
China’s Recession and it Impact
An economic slowdown in one region would lower the
aggregate demand
This should exert downward pressure on the global interest
rates.
High Asian saving rates have been a major factor in the decline
of the overall level of real interest rates in the United States and
Europe
A recession in China could paradoxically result in higher
interest elsewhere
According to Keynesian an economic slowdown in one region
would lower the aggregate demand, hence exerting downward
pressure on the global interest rates. However, the modern
thinking is more advanced. High Asian saving rates in the past
20 years have been a major factor in the decline of the overall
level of real interest rates in the United States and Europe,
courtesy of the fact that the underdeveloped Asian capital
markets are unable to absorb the surplus savings. Therefore,
rather than resulting in a lower global inflation adjusted interest
rates, a slowdown in China’s economy that spreads across the
Asian continent could paradoxically result in higher interest
elsewhere, particularly if another Asian financial crisis leads to
depletion of central bank reserves. Hence, a Chinese recession
would greatly affect the global markets (Rogoff, 2018).
12. 6
China’s Recession Data
References
Morrison, W. M. (2018). China’s economic rise: History, trends,
challenges, and implications for the United States.
Congressional Research Service, 1-53
Reserve Bank of Australia. (2017). Underlying consumer price
index in China. Bulletin | December Quarter. Retrieved from.
https://www.rba.gov.au/publications/bulletin/2017/dec/pdf/bu-
1217-4-underlying-consumer-price-inflation-in-china.pdf
Rogoff, K. (2018, November 7). A Chinese recession is
inevitable - don't think it won't affect you. The Guardian.
Retrieved from.
https://www.theguardian.com/business/2018/nov/07/a-chinese-
recession-is-inevitable-dont-think-it-wont-affect-you
8