Back in the dumps, India’s state-owned banks endure a string of bad news A brief flurry of optimism in the sector comes to an end Print edition | Finance and economics Feb 15th, 2018| MUMBAI OF LATE Indian bankers have felt an unfamiliar sensation: optimism. A 1.3trn-rupees ($21bn) bail-out from the government seemed to have cleaned up the bad lending decisions of years gone by. A new bankruptcy law gave them an edge in long-standing battles with recalcitrant borrowers. It seemed a few Indian companies, having for years eschewed fresh investment, might even start borrowing again. This week woes linked to mismanagement at India’s three biggest partially state-owned lenders plunged the bankers back to their habitual gloom. On February 14th Punjab National Bank (PNB) announced it was investigating a fraud worth 114bn rupees, equivalent to about a third of its market capitalization. A few days earlier the State Bank of India (SBI) unveiled its first quarterly loss since 1999. And Bank of Baroda has hastily announced the closure of its South African operation, accused of having shady business associations there. The Punjab heist is potentially the most serious. The second-largest nationalized bank admitted that employees in Mumbai had approved transactions that left PNB on the hook for $1.8bn. This suggests, to put it mildly, some lacunae in how the place is run. Its shares fell by over 10% as investors tried to assess whether the sum had been lost or was merely at risk. The bank has reportedly filed a complaint against a jeweler, Nirav Modi, and some of his family and businesses. Its accusation, to which Mr. Modi has not responded, is that he induced bank employees to issue letters of credit, which were left off PNB’s books. The letters of credit seem then to have been used as security to borrow from other banks overseas. Mr. Modi says he is willing to sell his businesses to make the banks whole. SBI’s troubles are far easier to grasp. Like other state-owned lenders, which control about two-thirds of assets in the banking system, SBI has repeatedly had to adjust its quarterly profits to recognize that some loans made in past years are unlikely to be repaid. Losses linked to bad loans soared in the most recent quarter, in part because the Reserve Bank of India, the regulator, forced SBI to recognize even more of its loans as duds than it had done previously. The regulator did not say whether it regarded SBI’s management as negligent, or dishonest. Finally, Bank of Baroda, the third-largest nationalized lender, on February 12th announced it would be pulling out of South Africa, one of a handful of markets it had entered in the past two decades. Its strategy of building its franchise by lending to the Indian diaspora had not reckoned with the Gupta brothers, three financiers accused of having undue influence in President Jacob Zuma’s inner circle. An investigation by the Hindustan Times and others detailed how Baroda stuck by the Guptas even as other banks pulled back. Baroda says it is co-operating with South African authorities, which are investigating. The bad news has helped to wipe out half the share-price gains of the 21 state-owned banks after the government’s rescue plan was unveiled in October. Most are trading below the stated value of their net assets, implying investors still don’t trust their accounts. Taken together, all the nationalized lenders are now worth less than HDFC Bank, a single private lender. It may be some time before optimism returns.
What was your reaction when you read this? What did you learn from this? What do you think is the solution to this problem.
Could similar problems arise in the USA? If so, what needs to be done nwo?
In: Accounting
Case study: The Good, the Bad and the Ugly - A Story of Vadym
Hetman As CEO of Avani International, Hetman headed the growth of a
corporate giant. At its peak, Avani was gobbling up 200 companies a
year. Under his leadership, the value of Avani increased 70-fold.
In 2011, Hetman proclaimed his desire to be remembered as the world
greatest business executive. Things turn sour when Hetman and his
former chief financial officer were accused of running criminal
enterprise within Avani. The two were charged stealing $170 million
directly from the company and pocketing an additional $450 million
through manipulated sales of stock. Hetman’s action has almost
destroyed the company where he worked for 25 years. In 2012 alone
the value of the company’s stock dropped $90 billion. Hetman spent
his early years in humble circumstances. He grew up in the 1960’s
in Jackson, Alabama. He said he was the son of a cop. It was only
after he was accused did it come out that his father was never a
police officer in Jackson or anywhere else. However, his mother did
work for the Jackson Police Department as a school crossing guard.
His father, in actuality, was a wheeler-dealer who was a practiced
deceiver and an effective persuader. He had a strong personality
but for the most part kept his misdeeds to little white lies.
Friends remember Hetman as an easygoing kid who did well in school
without trying very hard. He was elected “class politician” by high
school graduating class. He went on to Samford, paying his way to
college by playing guitar in a band. He served in Bangkok held a
few accounting job, and eventually joined Avani in 1980s. Over the
course of the 1990s, Hetman’s happy-go-lucky character disappeared.
As he climbed the ladder at Avani, he became a corporate tough guy,
both respected and feared. He eventually became CEO in 2001 and
administered the rapid expansion of the company. Meanwhile, Hetman
learned to live big. He had a $18 million apartment in Los Angeles,
a $35 million mansion in Georgia, and a $20 million yacht. He spent
$25 million on art for his luxury homes. He took extravagance to
the extreme, for instance, spending $5, 000 on a shower curtain.
The more he made, the more he spent, and the more he allegedly
stole. Although his total compensation was $160 million in 2008, it
wasn’t enough. He manipulated the company’s relocation fund and
Employee Loan Program to take hundreds of millions in interest-free
funds. In 2010 for instance, he gave his wife $1.5 million to start
a restaurant, spent $2 million on birthday party in the Hawaii
Island for his wife, and gave away $50 million in corporate funds
to make humanitarian contributions in his own name. (Source:
Adapted from Stephen, P. Robbins, “Organizational Behavior”,
2005)
1 Based on the case study:
(a) Examine Hetman’s personality trait.
(b) Discuss how Hetman’s past shaped his personality
(c) Based on your answer in (a). Discuss two (2) character traits that might influence Hetman’s behaviour and performance at work.
(d) Discuss two (2) factors present in the case study that most likely influence Hetman’s perception of achievement.
(e) Which motivation theory do you think best explains Hetman’s behaviour and work performance? Justify your answer.
(f) “Hetman just did what anybody would do if they had the chance. The people at fault in this case are Avani’s Board of Directors for not controlling their CEO”. Do you agree or disagree with this statement? Discuss your answer based on the characteristics of effective team.
(g) Discuss what Avani International should do if symptoms of groupthink exist in the company.
In: Operations Management
An area of research in biomechanics and gerontology concerns falls and fall-related injuries, especially for elderly people. Recent studies have focused on how individuals respond to large postural disturbances (e.g., tripping, induced slips). One question is whether subjects can be instructed to improve their recovery from such disturbances. Suppose researchers want to compare two such recovery strategies, lowering (quickly stepping down with front leg and then raising back leg over the object) and elevating (lifting front leg over the object). Subjects will have first been trained on one of these two recovery strategies, and they will be asked to apply it after they feel themselves tripping. The researchers will then induce the subject to trip while walking (but harnessed for safety) using a concealed mechanical obstacle. Suppose the following
24 subjects have agreed to participate in such a study: Females: Alisha, Alice, Betty, Martha, Audrey, Mary, Barbie, Anna
Males: Matt, Peter, Shawn, Brad, Michael, Kyle, Russ, Patrick, Bob, Kevin, Mitch, Marvin, Paul, Pedro, Roger, Sam
3.ALREADY HAVE THE ANWSER TO THIS JUST POSTING AS A REFERENCE FOR NEXT QUESTION (2 points) Let’s explore the process of random assignment to determine whether it does “work.” First, let’s focus on the sex (male vs. female) variable. Suppose we put each person’s name on a slip, put those slips in a hat and mix them up thoroughly, and then randomly draw out 12 slips for names of people to assign to the elevating strategy. What proportion of this group do you expect will be male? What proportion of the lowering strategy do you expect will be male? Do you think we will always get an 8/8 split (8 males in each treatment group)?
I'm confused as to the number of males to put in group 1 and group 2 in the applet
4A. (2 points) To repeat this random assignment a large number of times to observe the long-run behavior, we will use the Randomizing Subjects applet at http://www.rossmanchance.com/ISIapplets.html. Open the applet and press the Randomize button. State the proportion of male subjects that were assigned to Group 1 and to Group 2. What is the difference in these two proportions? NOTE: You will notice that the difference in proportions of males is shown in the dotplot in the bottom graph. In this graph, each dot represents one repetition of the random assignment process where we are recording the difference in proportions of men between the two groups.
B. (4 points) Press the Randomize button 4 more times, and report the proportion of male subjects that were assigned to Group 1 and to Group 2 for each of these pre
In: Statistics and Probability
1.
Find the present value of $725 due in the future under each of the following conditions. Do not round intermediate calculations. Round your answers to the nearest cent.
15% nominal rate, semiannual compounding, discounted back 5 years.
$
15% nominal rate, quarterly compounding, discounted back 5 years.
$
15% nominal rate, monthly compounding, discounted back 1 year.
$
2.
Find the present values of the following cash flow streams. The appropriate interest rate is 10%. (Hint: It is fairly easy to work this problem dealing with the individual cash flows. However, if you have a financial calculator, read the section of the manual that describes how to enter cash flows such as the ones in this problem. This will take a little time, but the investment will pay huge dividends throughout the course. Note that, when working with the calculator's cash flow register, you must enter CF0 = 0. Note also that it is quite easy to work the problem with Excel, using procedures described in the Ch04 Tool Kit.xlsx.) Do not round intermediate calculations. Round your answers to the nearest cent.
| Year | Cash Stream A | Cash Stream B |
| 1 | $100 | $250 |
| 2 | 400 | 400 |
| 3 | 400 | 400 |
| 4 | 400 | 400 |
| 5 | 250 | 100 |
Stream A: $
Stream B: $
What is the value of each cash flow stream at a 0% interest rate? Round your answers to the nearest dollar.
Stream A $
Stream B $
3.
Find the present value of the following ordinary annuities. (Notes: If you are using a financial calculator, you can enter the known values and then press the appropriate key to find the unknown variable. Then, without clearing the TVM register, you can "override" the variable that changes by simply entering a new value for it and then pressing the key for the unknown variable to obtain the second answer. This procedure can be used in many situations, to see how changes in input variables affect the output variable. Also, note that you can leave values in the TVM register, switch to Begin Mode, press PV, and find the PV of the annuity due.) Do not round intermediate calculations. Round your answers to the nearest cent.
$600 per year for 10 years at 8%.
$
$300 per year for 5 years at 4%.
$
$600 per year for 5 years at 0%.
$
Now rework parts a, b, and c assuming that payments are made at the beginning of each year; that is, they are annuities due.
Present value of $600 per year for 10 years at 8%: $
Present value of $300 per year for 5 years at 4%: $
Present value of $600 per year for 5 years at 0%: $
In: Finance
QUESTION 1
In a keyboard event, what is the difference between typing 'a' and 'A'?
| a |
different characters are in the event |
|
| b |
a LowerKeyEvent is sent instead of an UpperKeyEvent |
|
| c |
a modifier indicates if the Shift key was pressed or not |
|
| d |
upper case letters are only delivered to the focus window |
QUESTION 2
Select all of the following which can be used to gather information for personas.
| a |
questionnaires |
|
| b |
interviews |
|
| c |
observation |
|
| d |
tests of how people use the interface |
QUESTION 3
A user wishes to purchase a book from a website. Select all of the following that are needs of the user.
| a |
the user needs to provide the address to deliver the book |
|
| b |
the user needs to like books |
|
| c |
the user needs to select the book |
|
| d |
the user has a need for the book |
QUESTION 4
A persona contains
| a |
the characteristics common to all users |
|
| b |
the characteristics of one category of user |
|
| c |
the characteristics of the people who will not use the system |
|
| d |
all the characteristics of an individual |
QUESTION 5
Which of the following are functional requirements?
| a |
the calculations the program must perform |
|
| b |
the number of transactions per second the program can handle |
|
| c |
the volume of data the program can handle |
|
| d |
the exact information which must be entered into the program |
QUESTION 6
Why are mouse move events only delivered when a mouse button is pressed?
| a |
because mouse move events are started by a mouse press/release and terminated by a second mouse press/release |
|
| b |
because they use a default handler in no mouse button is pressed |
|
| c |
because they are usually only needed during drag operations |
|
| d |
because the mouse only moves when a mouse button is pressed |
QUESTION 7
Select all of the following information should be included in a persona for a customer of an online bookstore
| a |
the customer's favourite colour |
|
| b |
they type of car the customer drives |
|
| c |
the type of book the customer enjoys |
|
| d |
the amount of disposable income the customer has |
QUESTION 8
A signal
| a |
is sent when a user action is performed |
|
| b |
is sent when a widget does something and wants to notify other code |
|
| c |
is sent when a widget detects several events happening in the correct sequence |
|
| d |
is sent when an event is delivered to a window |
QUESTION 9
In focus follow keyboard events are delivered to
| a |
the window which was last clicked |
|
| b |
the nearest window with a text input widget |
|
| c |
the window containing the mouse |
|
| d |
the root window |
QUESTION 10
A GUI timer can be inaccurate due to
| a |
the speed of the hardware on which the GUI is running |
|
| b |
the GUI not receiving updates from the system clock |
|
| c |
finite precision of the system clock |
|
| d |
taking a long time to process a GUI event |
In: Computer Science
BONUS: Create the detailed outline of this compare/contrast essay (10%)
‘Each small innovation generated changes in his life and in everyone’s. Whether it is a language system or a poem, they make the universe a different place’. let us compare between Nikola Tesla and Thomas Alva Edison. discoverer contributed to the event of the alternating-current (AC) electrical system which is widely used today and to the rotating flux, which is that the basis of most AC machinery while Edison invented the DC which is a smaller amount widely utilized in the current but he has many great inventions just like the electric bulb the phonograph and lots of more.
Edison and tesla worked together before tesla parted ways because of business scientific conflict. While Edison was an influential figure who focused on marketing and financial success, Tesla wasn't business-minded and was somewhat vulnerable because of which tesla suffered plenty to run his company. Edison managed to convince his investors about his inventions but tesla couldn't so he suffered.
In the end, Edison held 1,093 patents and Tesla held but 300 worldwide. Of course, Edison had a bunch of assistants helping him devise inventions and had also bought a number of these patients.
Tesla's inventions are the backbone of contemporary power and communication systems, but he faded into anonymity later within the 20th century. But later his invention caught the attention of an engineer and acquired his patents he saw that it's a future. But Edison had dispelled Tesla's AC system of electrical power transmission, calling it 'impractical', instead of promoting his simpler yet less efficient DC system.
Tesla didn't get the celebrity he deserved besides his inventions was of great practical use. Edison also launched a negative press-campaign in a trial to undermine the interest in AC power. With its repeated success and favorable press, the alternating-current system became the leading facility of the 20th century and it's remained the worldwide standard since.
Tesla suffered a breakdown and eventually returned to the figure as a consultant primarily. But as time passed, his ideas progressively became strange and impractical. He also grew increasingly eccentric and devoted much of his time in caring for wold pigeons in the big apple City's parks. He even drew the FBI's attention for his mouth building a robust "death beam", which had also received some interest from the state during warfare II.
In: Psychology
Discussion Topic: What are the different types of hearing loss? Follow the discussion guidelines below.
For the case study section only: Please only provide short answers for the case study No more than 2 sentence response. Answer all the questions in all case study scenarios.
Mason is a 7-year-old boy who is at his primary care physician for a routine physical examination. Mason’s mother expresses concern about childhood obesity and is worried that he sleeps too much.
Subjective Data: Mason has been eating more than usual. Mason sleeps between 11 and 12 hours a day. Mason plays team soccer.
Objective Data
Height: 121 cm
Weight: 23 kg
Vital signs: temp, 37º C; pulse, 78 bpm; resp, 22 breaths/min; blood pressure, 102/62 mm Hg
Height: 90 cm
Mason has a normal physical examination for his age.
Questions:
Caroline is an 11-year-old girl who has an inoperable brain tumor. Caroline has been admitted for palliative care. Her mother, father, and two siblings are with her.
Subjective Data: Caroline complains of a severe headache. She states that she is “afraid to be alone.”
Objective Data
Vital signs: temp, 37.8º C; pulse, 120 bpm; resp, 24 breaths/min; blood pressure, 110/60 mm Hg
Caroline is unable to walk unassisted.
Her pupils are unequal 4 mm right and 6 mm left.
Questions:
3. Case Study: Hyphema
Johnny is a 10-year-old boy who seeks care after being hit in the right eye with a stuffed snake by his brother 15 minutes before arrival.
Subjective Data: Johnny complains of light sensitivity. Vision in the right eye is blurred.
Objective Data
Vital signs: temp, 36.8º C; pulse, 90 bpm; resp, 18 breaths/min; blood pressure, 110/60 mm Hg
Pupils: Left, 3 mm briskly reactive to light. Right, 3 mm and sluggishly reactive to light
Visual acuity: Right eye unable to see chart; left eye 20/15
Approximately a 30% hemorrhage is noted to the anterior chamber of the right eye with an intact globe.
Questions:
In: Nursing
Discussion Topic: What are the different types of hearing loss? Follow the discussion guidelines below.
For the case study section only: Please only provide short answers
for the case study No more than 2 -3 sentence response. Answer all
the questions in all case study scenarios.
1. Case Study: Childhood Obesity
Mason is a 7-year-old boy who is at his primary care physician for a routine physical examination. Mason’s mother expresses concern about childhood obesity and is worried that he sleeps too much.
Subjective Data: Mason has been eating more than usual. Mason sleeps between 11 and 12 hours a day. Mason plays team soccer.
Objective Data
Height: 121 cm
Weight: 23 kg
Vital signs: temp, 37º C; pulse, 78 bpm; resp, 22 breaths/min;
blood pressure, 102/62 mm Hg
Height: 90 cm
Mason has a normal physical examination for his age.
Questions:
What should the nurse tell Mason’s mother when discussing her
concerns about childhood obesity?
What can Mason’s mother do to help Mason maintain a healthy
weight?
Mason’s mother has questions about his joining a soccer team. What
should the nurse tell her?
2. Case Study: Brain Tumor
Caroline is an 11-year-old girl who has an inoperable brain tumor.
Caroline has been admitted for palliative care. Her mother, father,
and two siblings are with her.
Subjective Data: Caroline complains of a severe headache. She
states that she is “afraid to be alone.”
Objective Data
Vital signs: temp, 37.8º C; pulse, 120 bpm; resp, 24 breaths/min;
blood pressure, 110/60 mm Hg
Caroline is unable to walk unassisted.
Her pupils are unequal 4 mm right and 6 mm left.
Questions:
What is the most immediate priority for Caroline?
How can Caroline’s nurse help with Caroline’s fears?
How can Caroline’s nurse maintain professional boundaries?
3. Case Study: Hyphema
Johnny is a 10-year-old boy who seeks care after being hit in the
right eye with a stuffed snake by his brother 15 minutes before
arrival.
Subjective Data: Johnny complains of light sensitivity. Vision in
the right eye is blurred.
Objective Data
Vital signs: temp, 36.8º C; pulse, 90 bpm; resp, 18 breaths/min;
blood pressure, 110/60 mm Hg
Pupils: Left, 3 mm briskly reactive to light. Right, 3 mm and
sluggishly reactive to light
Visual acuity: Right eye unable to see chart; left eye 20/15
Approximately a 30% hemorrhage is noted to the anterior chamber of
the right eye with an intact globe.
Questions:
Johnny is at risk for what complications?
What measures may help prevent these complications?
What should the nurse do in this situation? Prioritize these
actions.
In: Nursing
Plz convert this C++ code into JAVA code thanks
#include<iostream>
using namespace std;
//function for calculating the average sightings from the Total
Sightings array
float calcAverage(float totalSightings[],int n)
{
int i;
float sum=0.0;
for(i=0;i<n;i++)
sum=sum+totalSightings[i];
return sum/n;
}
int main()
{
// n is no. of bird watchers
//flag , flag2 and flag3 are for validating using
while loops
int n,i,flag,flag2,flag3;
//ch also helps in validating
char ch;
cout<<"------------------Welcome to the Prince
William County Bird Watching weekend tracking
system---------------------";
while(1)
{
cout<<"\nPlease enter the
number of bird watchers:\n";
cin>>n;
if(n==0)
{
flag=1;
break;
}
else if(n>0 and n<100)
{
flag=2;
break;
}
else
{
/*
here I have
added ch as an extra variable cause you don't tell in the question
that what happen if user enters value equal to
greater than 100
, you have only told for between 0 and 100 and for 0 also,thats why
i added this
*/
cout<<"\nInvalid input, want to enter again , if yes press
'y' else 'n' for no : ";
cin>>ch;
if(ch=='y')
continue;
else
{
flag=1;
break;
}
}
}
//prints the goodbye message
if(flag==1)
{
cout<<"\nGoodbye !!";
}
//if user enters valid n , then :-
else if(flag==2)
{
char BirdWatcherName[n][30]; //
this char array is for entering the names of the bird
watchers
float
SightingSaturday[n],SightingSunday[n],totalSightings[n]; //these
functions are for sightings on saturday,sunday and total sightings
respectively.
for(i=0;i<n;i++)
{
cout<<"\n-------------------------Bird
Watcher"<<i+1<<" -------------------------";
cout<<"\nPlease enter the bird watcher’s Name:\n";
//clearing
buffer
cin.clear();
cin.sync();
cin.getline(BirdWatcherName[i],30);
ch='y';
//this while
loop is for validating that the sightings quantity is between 0 and
250 or not .And flag2 helps in checking this.
while(ch!='n')
{
cout<<"\nPlease enter the birds sighted on
Saturday:\n";
cin>>SightingSaturday[i];
if(SightingSaturday[i]<0 ||
SightingSaturday[i]>250)
{
cout<<"\nInvalid input
, wanna enter again? , press 'y' for yes or 'n' for no :- ";
cin>>ch;
if(ch=='y')
{
continue;
}
else
{
flag2=2;
break;
}
}
else
{
flag2=1;
break;
}
}
if(flag2==2)
{
flag3=2;
break;
}
else
{
ch='y';
//this while loop is again for validating that the
sightings quantity is between 0 and 250 or not .And flag2 helps in
checking this.
while(ch!='n')
{
cout<<"\nPlease enter
the birds sighted on Sunday:\n";
cin>>SightingSunday[i];
if(SightingSunday[i]<0 ||
SightingSunday[i]>250)
{
cout<<"\nInvalid input , wanna enter again? , press 'y' for
yes or 'n' for no :- ";
cin>>ch;
if(ch=='y')
{
continue;
}
else
{
flag3=2;
break;
}
}
else
{
flag3=1;
break;
}
}
}
if(flag3==2)
{
break;
}
}
if(flag3==2)
{
cout<<"\nGoodbye";
}
else
{
cout<<"\n------------------------------------------------PWC
Birdwatching
Statistics---------------------------------------------\n";
cout<<"\nBird Watcher SaturdaySighings Sunday Sightings Total
Sightings";
for(i=0;i<n;i++)
{
totalSightings[i]=SightingSaturday[i]+SightingSunday[i];
}
for(i=0;i<n;i++)
{
cout<<endl<<BirdWatcherName[i]<<"
"<<SightingSaturday[i]<<"
"<<SightingSunday[i]<<"
"<<totalSightings[i];
}
//calling for
the calcAverage() function for calculating the average of total
sightings
cout<<"\nAverage Sightings
"<<calcAverage(totalSightings,n)<<endl;
//this part is
for finding maximum total sighting and its index
int index;
float
maximum;
maximum=totalSightings[0];
for(i=0;i<n;i++)
{
if(totalSightings[i]>maximum)
{
maximum=totalSightings[i];
index=i;
}
}
cout<<"\nThe Bird Watcher with the most sightings of
"<<totalSightings[index]<<" is
"<<BirdWatcherName[index];
//program
over
cout<<"\n----------------------------------------------Thanks
For Using Our Program---------------------------------";
}
}
return 0;
}
In: Computer Science
We will do some basic data analysis on information stored in external files.
You will find the following data files in the Source Code -> Chapter 7 folder you should have downloaded already downloaded/unzipped in Lesson 3. If you need that link again:
Pyton4E_Source_Code.zip
GirNames.txt
contains a list of the 200 most popular names given to girls born
in US from year 2000 thru 2009
BoyNames.txt
contains a list of the 200 most popular names given to boys born in
US from year 2000 thru 2009
Hint: See Program 7-15
read_list.py for example of reading a file's
contents into a list and using a loop to strip each \n
Here is the high-level algorithm (you still have work to do
:)
open BoyNames.text for reading
read all lines into a list
close the file
while there are elements in list
strip the \n from each element
open GirlNames.txt for reading
read all lines into a list
close file
while there are elements in list
strip \n from each element
get user input for boy
get user input for girl
display result for boy's name entered by user (you
need a decision structure as output depends on user
input)
display result for girl's name entered by user
(you need a decision structure as output depends on user
input)
Input: a boy's name, a girl's name, or 'N' for
none
Output: messages indicating whether the names were
among the most popular
Note: Use a try/except to
catch IOError
as anytime we deal with external files, problems may occur (file
doesn't exist, we don't have permissions, disk is corrupted, and so
on).
Sample Input/Output
IMPORTANT NOTE: The external files MUST be in same directory as your source code.
You may run your code on the command line/system prompt (as I have done) OR from IDLE (Run->Run Module or F5).
Here is first run showing output when user input for both boy and girl are popular names (user input shown in italics/bold ).
Enter a boy's name, or N if you do not wish to enter a boy's name: Michael Enter a girl's name, or N if you do not wish to enter a girl's name: Emma Michael is one of the most popular boy's names. Emma is one of the most popular girl's names.
Here is a second run where user says 'N' to entering names
$ python babyname.py Enter a boy's name, or N if you do not wish to enter a boy's name: N Enter a girl's name, or N if you do not wish to enter a girl's name: N You chose not to enter a boy's name. You chose not to enter a girl's name.
Here is third run showing user input with a girl name not in the GirlNames.txt file:
$ python babyname.py Enter a boy's name, or N if you do not wish to enter a boy's name: John Enter a girl's name, or N if you do not wish to enter a girl's name: Ada John is one of the most popular boy's names. Ada is not one of the most popular girl's names.
Note: We will test code with THREE sample runs:
this is what i did for this assignment but i got some error could you please help me with it
def main():
#open BoyNames.text for reading
infile = open('BoyNames.text', 'r')
#read all lines into a list
BoyNames = infile.readlines()
#close the file
infile.close()
#while there are elements in list
#strip the \n from each element
index = 0
while index < len(BoyNames):
BoyNames[index] = BoyNames[index].rstrip('\n')
index += 1
#open GirlNames.txt for reading
infile = open('GirlNames.txt', 'r')
#read all lines into a list
GirlNames = infile.readlines()
#close the file
infile.close()
# while there are elements in list
# strip \n from each element
index = 0
while index < len(GirlNames):
GirlNames[index] = GirlNames[index].rstrip('\n')
index += 1
#get user input for boy
try:
BoyName = input ("Enter a boy's name, or N if you do not wish to
enter a boy's name:")
print (BoyNames)
GirlName = input ("Enter a gilr's name, or N if you do not wish to
enter a girl's name:")
print (GirlNames)
except IOError:
print ("You chose not to enter a girl's name.")
main()
In: Computer Science