Looking for Python code for below problem: ------------------------------------------------------...

Looking for Python code for below problem:

------------------------------------------------------------

The Creative Door Logistics is a successful name in the e-commerce vertical. The company’s development team is just trying to implement their online invoice management application, which will help its customers to purchase and get the invoice generated for the items in the shipping list. To begin with, they start with few modules of the application. Help the development team for writing codes for login validation, making a purchase and displaying the purchase details.

Initially, the application reads the username from the user, if invalid credentials are given then print “Invalid Username and Password” and terminate the application.

Once a valid Username and Password is given, the application should print “Login Successful” and then prompt the item to be purchased.

Display “Item not present” if the item number is not present in the item file in the main. If the valid item number is given, the application should prompt for the quantity of the item to be purchased. Use the prompt “Do you want to add one more item?(Yes or No)” to add more items to the list.

When the user chooses “No” from the above prompt, the list of items along with item number, item name, quantity and the cost is displayed with the total cost of the shopping list.

When the user selects Exit, the application terminates

Note:

The list of registered users is available in an xml file names userpass.xml

The list of items is available in an xml file named item.xml

Method Description:

Method Name

Arguments

Return Type

Description

validateUsernamePassword()

Users file name(userFile), userName, password

userFile- string

username- string

password- string

Boolean

This function validates the username and password.

Print “Login Successful” and return True, if valid user; else print “Invalid username and password” and return False”

checkItemPresent()

Item File name(itemFile), itemNo.

itemFile- string

itemNo- integer

Boolean

This function will check whether the itemNo is present in the itemFile or not. Return True if the item is present, else return False.

purchaseItem()

Item File name(itemFile), username, itemNo, quantity.

itemFile-string

username- string

itemNo- integer

quantity-integer

List

This function checks whether the given item has the specified quantity present. If present, build a list with elements- itemNo, itemName, quantity and cost, and return the list. If the specified quantity is not present, print “The required quantity is not available” and return an empty list.

calculateAmount()

purchaseList

purchaseList- list of purchased items

Integer

This function calculates the total cost for the purchased items.

userpass.xml

<userList>

  <user>

     <username>Soukhya</username>

     <password>soky</password>

</user>

<user>

      <username>Sahana</username>

      <password>sana</password>

</user>

<\userList>

item.xml

<itemList>

    <item>

        <itemNo>51</itemNo>

        <name>Tops</name>

        <cost>700</cost>

      <quantity>50</quantity>

   </item>

   <item>

      <itemNo>52</itemNo>

      <name>Shoes</name>

      <cost>1800</cost>

      <quantity>65</quantity>

   </item>

</itemList>

Sample input and output 1:

Enter username:

Sahana

Enter password:

soanaa

Invalid Username and Password

Sample input and output 2:

Enter username:

Sahana

Enter password:

sana

Login successful

1.Purchase Item

2.Exit

Enter your choice:

1

Enter item number:

51

Enter quantity of item:

200

The required quantity is not available.

Do you want to add one more item?(Yes/No):

Yes

Enter item number:

52

Enter the quantity of item:

2

Do you want to add one more item?(Yes/No):

No

Item No Name Quant Cost

52 Shoes 2 1800

Total Cost = 3600

1.Purchase item

2.Exit

Enter your choice:

2

Sample input output 3:

Enter username:

Sahana

Enter password:

sana

Login Successful

1.Purchase item

2.Exit

Enter your choice:

1

Enter item number:

501

Item not present

Enter item number:

51

Enter quantity of item:

1

Do you want to add one more item?(Yes/No):

Yes

Enter the item number:

52

Enter quantity of item:

2

Do you want to add one more item?(Yes/No):

No

Item No Name Quant Cost

51 Tops 1 700

52 Shoes 2 1800

Total cost = 4300

1.Purchase item

2.Exit

Enter your choice:

2

-------------------------------------------

Thanks in advance.

Solved
COMPUTER SCIENCE 1 Answer Tarek Shohdy

QUESTION 1: Introductory Case: Your uncle owns and operates a small retail store that sells the o...

QUESTION 1: Introductory Case: Your uncle owns and operates a small retail store that sells the outdoor clothing of a Ghanaian manufacturer to the predominantly college-student market at KNUST. Lately, a large department store in Kumasi has started selling similar but lower-priced clothing manufactured in China. Your uncle is starting to lose business to this new store. A business associate of your uncle suggested that he considers selling over the internet. Your uncle is the ‘old school type’ who doesn’t even have an email and he has his doubts about getting into something he doesn’t understand. When your uncle heard that you had recently completed a course in e-business, he got excited and contacted you to analyze the situation and offer some suggestions. Your uncle is very much worried about the drastic change that this e-business approach will have on his business and he wonders how he will cope with managing this change. In view of the above, answer ALL the following questions; (a) Explain to your uncle what e-business is? (4 Marks) (b) Explain any two (2) benefits of adopting e-business to your uncle. (4 Marks) (c) Explain any two (2) challenges your uncle is likely to face when he attempts to adopt e-business. (4 Marks) (d) Explain to your uncle what change management is? (4 Marks) (e) Your uncle being an ‘old school’ person is afraid of taking risks. Explain risk management in the context of e-business to him, explaining any three (3) risks factors he is likely to face and your suggestions on how he can overcome them. (10 Marks) (f) What is an online revenue model? Explain any four (4) online revenue models that will fit perfectly with your uncle’s product offering. (10 Marks) (g) State and explain with examples any two (2) trading locations in the electronic marketplace your uncle wants to enter. Which of these locations will be his domain? (6 Marks)

QUESTION 2: (a) A local SME that produces leather goods in Kumasi is considering going global with an online presence. The CEO is of the view that adopting e-business will enable his company improve its own internal business process also. The CEO’s dilemma is whether to employ IT personnel or whether to outsource. You have been brought in as a consultant to guide the company in analyzing the outsourcing versus in-house development options. What will your advice be and what factors would you take into consideration in arriving at your solution? (8 marks

Solved
ECONOMICS 1 Answer Yana Luisa

Situation IV. At 10°C, the rigid horizontal slab is attached to two identical copper rods as show...


Situation IV. At 10°C, the rigid horizontal slab is attached to two identical copper rods as shown in Fig. 4. A (mm2) E (GPa)

Copper Aluminum Fig. 4 Copper 150 mm

Solved
Civil Engineering 1 Answer Ghaida Hassan

.Suppose your employer allows you to use your own smartphone for work purposes but only if the em...

.Suppose your employer allows you to use your own smartphone for work purposes but only if the employer can install software to erase the phone's information if it is lost, stolen, or if you leave the company. Describe the possible pros and cons you would consider in deciding whether to accept this agreement. What do you think your final decision would be?

Solved
ECONOMICS 1 Answer ryan p

Given you are the Project Manager in the case study enclosed and based from the article provided,...

Given you are the Project Manager in the case study enclosed and based from the article provided,

i. Identify all stakeholder involved in this project. (5 marks)

ii. Analyse each stakeholder interest and power using a Perceptual Diagram. (5 marks)

iii. Identify the key stakeholders of this project and suggest the best communication medium with them. (5 marks)

iv. Explain your strategy in managing stakeholder with restraining force that might hinder your project success. (15 marks)

Question 2

Fuss, flurry over land reclamation in Penang Retrieved from The Malaysian Insider on 29 December 2015 A storm of controversy continues to rage over land reclamation policies and practices in Penang, as various stakeholders dig their heels in on their respective stands. On one hand, local residents, activists and politicians have adamantly demanded the projects be halted, saying that the survival of local fishermen and the environment are at stake. The state government, on the other, said the projects were in the public interest and it risked having to pay RM1 billion in compensation should it suspend approved land reclamation projects. The issue flared up after Umno assemblyman for Pulau Betong, Muhamad Farid Saad (pic), tabled a motion at the state legislative assembly last month, to compel the state government to subject land reclamation projects to public hearings. He also wanted all new reclamation projects to be put on hold until detailed studies could be conducted to ensure that the proposed land reclamation projects would not adversely impact the environment. Speaking to The Malaysian Insider recently, Farid said he decided to table the motion when he failed to get a clear answer on what was going on when makeshift platforms began to appear in the sea off the southern coast of the island a few months ago. "I knew some activities were happening off Permatang Damar Laut due to the platforms. At that time, it was not clear what the project was. I asked the chief minister, and he said he was not aware. "But later Chow (local government, traffic management and flood mitigation exco Chow Kon Yeow) confirmed the land reclamation. So I tabled that motion." Farid said he was not disputing the fact that the state held public hearings on such projects, but the government must also realise that environmental issues were important matters to Penangites. "While the state argues that it has been conducting public hearings, there are still citizens like fishermen and non- governmental organisations like Penang Forum raising questions about land reclamations and hill developments. "It means the people care about such matters. If they proceed with the southern reclamation, it is going to be huge." His move had indeed sparked a huge debate in the state assembly. When it was time to vote, DAP's Tanjung Bungah rep Teh Yee Cheu, who is known for his sensitivity towards environmental issues in Penang, joined nine Barisan Nasional assemblymen, including Farid, in supporting the motion. Five PKR assemblymen - Ong Chin Wen (Bukit Tengah), Cheah Kah Peng (Kebun Bunga), Lee Khai Loon (Machang Bubuk), Dr T. Jayabalan (Batu Uban) and Dr Norlela Ariffin (Penanti) abstained from voting, "in accordance with their conscience". The motion however failed to garner enough support with 23 state government backbenchers voting against it, but the decision of the six, who broke rank, created an uproar in the DAP-led administration. Teh later apologised for his "mistake” while the five PKR reps stood their ground, with backing from their party central leadership. Chief Minister Lim Guan Eng meanwhile called the abstention was good as supporting Umno's motion and an act of mutiny from within". In the following weeks, many statements were made with Lim saying that the previous Barisan Nasional (BN) government had parcelled out 1,311.58 hectares of land reclamation compared with the 24.28 hectares of land reclamation approved by the present state government in Bayan Mutiara and Bayan Bay. He also said that the state government was bound by the land reclamation approvals of the previous BN state government. Any postponement or suspension of the projects would put it at risk of having to pay RM1 billion in compensation, which can potentially bankrupt Penang. The bickering was perhaps timely, with the second phase of the Seri Tanjung Pinang (STP) project, a development inked in the days of BN, kicking off soon; and with an even bigger one being proposed to finance the state's ambitious RM27 billion Penang Transport Master Plan (PTMP). Although both projects are a cause for concern among fishing communities and civil groups and environmentalists, Pulau Tikus assemblyman Yap Soo Huey agreed with Lim that Farid's motion was redundant. "The intention seemed to be to cause doubt and give the impression that the state government does not want public hearings," the DAP rep said.

Solved
Supply Chain Management/Operations Management 1 Answer John Smith

What opportunities does the informal economy present to firms operating in the formal economy?

3. What opportunities does the informal economy present to firms operating in the formal economy?

The Informal Economy: What It Is and Why It Is Important?

The informal economy refers to commercial activities that occur at least partly outside a governing body’s observation, taxation, and regulation. In slightly differ- ent words, sociologists Manuel Castells and Alejandro Portes suggest that the “informal economy is character- ized by one central feature: it is unregulated by the insti- tutions of society in a legal and social environment in which similar activities are regulated.” Firms located in the informal economy are typically thought of as busi- nesses that are unregistered but that are producing and selling legal products (that is, they sell many of the same products you might buy in legal businesses but perhaps cheaper because they do not pay government fees and taxes). In contrast to the informal economy, the formal economy is comprised of commercial activities that a governing body taxes and monitors for society’s bene- fit and whose outputs are included in a country’s gross domestic product. For some, working in the informal economy is a choice, such as is the case when individuals decide to supplement the income they are earning through employment in the formal economy with a second job in the informal economy. However, for most people work- ing in the informal economy is a necessity rather than a choice—a reality that contributes to the informal econo- my’s size and significance. Although generalizing about the quality of informal employment is difficult, evidence suggests that it typically means poor employment condi- tions and greater poverty for workers. Estimates of the informal economy’s size across coun- tries and regions vary. In developing countries, the infor- mal economy accounts for as much as three-quarters of all nonagricultural employment, and perhaps as much as 90 percent in some countries in South Asia and sub- Saharan Africa. But the informal economy is also prom- inent in developed countries such as Finland, Germany, and France (where the informal economy is estimated to account for 18.3 percent, 16.3 percent, and 15.3 percent, respectively, of these nations’ total economic activity). In the United States, recent estimates are that the infor- mal economy is now generating as much as $2 trillion in economic activity on an annual basis. This is double the size of the U.S. informal economy in 2009. In terms of the number of people working in an informal economy, it is suggested that “India’s informal economy … (includes) hundreds of millions of shopkeepers, farmers, construc- tion workers, taxi drivers, street vendors, rag pickers, tai- lors, repairmen, middlemen, black marketers, and more.” There are various causes of the informal economy’s growth, including an inability of a nation’s economic environment to create a significant number of jobs rel- ative to available workers. This has been a particularly acute problem during the recent global recession. In the words of a person living in Spain: “Without the under- ground (informal) economy, we would be in a situation of probably violent social unrest.” Governments’ inabil- ity to facilitate growth efforts in their nation’s economic environment is another issue. In this regard, another Spanish citizen suggests that “what the government should focus on is reforming the formal economy to make it more efficient and competitive.” In a general sense, the informal economy yields threats and opportunities for formal economy firms. One threat is that informal businesses may have a cost advantage when competing against formal economy firms because they do not pay taxes or incur the costs of regulations. But the informal economy surfaces oppor- tunities as well. For example, formal-economy firms can try to understand the needs of customers that infor- mal-economy firms are satisfying and then find ways to better meet their needs. Another valuable opportunity is to attract some of the informal economy’s talented human capital to accept positions of employment in formal economy firms.

1. What are the implications of the informal economy for firms that operate only in the formal economy?

2. When firms consider analyzing their competition, should they include firms in the informal economy? Please explain why or why not.

3. What opportunities does the informal economy present to firms operating in the formal economy?

4. What threats does the informal economy present to firms operating in the formal economy?

5. How do firms operating in the formal economy identify and analyze the parts of the informal economy relevant to their strategies?

Please provide examples, thank you

Solved
Economic Integration 1 Answer Jenny Carrillo

4. (20) Two sampling experiments named "A örneklemi" and "B örneklemi" contains two sample sets i...

4. (20) Two sampling experiments named A örneklemi and B örneklemi contains two sample sets in each. The plots below show

Solved
STATISTICS 1 Answer SHAHBAZ SHOUKET