Question

In: Computer Science

Your software company was invited to provide a proposal for a company in Australia. You currently...

Your software company was invited to provide a proposal for a company in Australia. You currently have the cost in US dollars and need to convert the prices to the Australian dollar. Write a 2-part program using Ruby, Java®, or Python. Part 1: Write a function to gather the following costs from the user: Travel Cost: $9,800 Hotel Cost: $3,500 Rental Car Cost: $1,600 Labor Cost: $15,500 Part 2: Write a function to convert the costs from United States dollar (USD) to Australian dollar (AUD). Note: Look up the current USD to AUD exchange rate to use in your function. Test the program 3 times by providing different costs in USD. Provide the code and take a screenshot of the output, then paste the screenshot(s) into a Microsoft® Word document. Write a half-page response in the same Microsoft® Word document to address the following: Provide a manual for the user explaining how to use the program. Explain what type of user input validations you should have. What happens if the user enters a negative number? What happens if the user puts a $ in the input?

Solutions

Expert Solution

Python Program:

def getInput(st):
   """ Function that reads the input from user """
   try:
       # Reading costs from user
       cost = float(input("Enter " + st + " : "))
          
       # Checking for negative amount
       if cost < 0:
           print("\n Please enter positive amount.. ")
           getInput(st)
          
       # Returning cost  
       return cost
      
   except:
       # Printing error message
       print("\nError: Please input positive amount with out $ symbol")
       getInput(st)

      
def convert_USD_AUD(USD):
   """ Conversion from USD to AUD """
   # Conversion Factor
   # 1 USD = 1.47923 AUD
   return (USD * 1.47923)
  
  
def main():
   """ Python program that converts USD to AUD """
   # Reading costs from user
   travelCost = getInput("Travel Cost")
   hotelCost = getInput("Hotel Cost")
   rentalCarCost = getInput("Rental Car Cost")
   laborCost = getInput("Labor cost")
  
   # Converting Cost from USD to AUD
   a_travelCost = convert_USD_AUD(travelCost)
   a_hotelCost = convert_USD_AUD(hotelCost)
   a_rentalCarCost = convert_USD_AUD(rentalCarCost)
   a_laborCost = convert_USD_AUD(laborCost)
  
   # Printing costs in AUD
   print("\n\n Costs in AUD: \n")
   print("\n Travel Cost: %.2f"%(a_travelCost))
   print("\n Hotel Cost: %.2f"%(a_hotelCost))
   print("\n Rental Car Cost: %.2f"%(a_rentalCarCost))
   print("\n Labor Cost: %.2f \n\n"%( a_laborCost))
  

# Calling main function
main()

______________________________________________________________________________________________________

Sample Run:

___________________________________________________________________________________________________

If a negative number is entered, user will be prompted again...

If an amount is entered with dollar symbol, user will be prompted again...


Related Solutions

You hare creating a Request for proposal. You are a software development company upgrading an outdated...
You hare creating a Request for proposal. You are a software development company upgrading an outdated system. Below are the scope of services. Consultant shall assess existing functions and develop a system based on an Oracle platform in a Microsoft Windows 10 or later environment. Consultant shall deliver a complete system, beta tested, fully debugged, documented and deployable on remote computers around the globe. Training for system administrators shall be included as required. Documentation shall be CD based for printing...
Assume you have been invited to be a Director of your chosen company. As you are...
Assume you have been invited to be a Director of your chosen company. As you are new to the role (being on a Board of Directors of an Issuer) discuss the legal requirements, ethical considerations and best practice to be effective in this role of Director.
Provide a proposal of blue ocean strategy for a company you choose. Draw Strategy Canvas for...
Provide a proposal of blue ocean strategy for a company you choose. Draw Strategy Canvas for the proposal and explain the details for each factor on the canvas. Procedures to finish a strategy canvas: a. Identify the key factors industry is taken for granted as important. b. Identify two major competitors and draw the value curve for them c. Identify new factors you want to eliminate, reduce, increase and create d. Draw the value curve for the company you choose....
Currently, you own 2,230 common shares of a company. The company will provide a dividend of...
Currently, you own 2,230 common shares of a company. The company will provide a dividend of $1.65 per share next year, no dividend in two years from today, and a liquidating dividend of $35.70 per share in three years from today. The require return on the common shares is 8.77%. You want a total cash flow of just $650 next year and will use any excess received to buy more shares of the company. How much total dividends will you...
IN JAVA your software company has been requested to provide a prototype program performing the simple...
IN JAVA your software company has been requested to provide a prototype program performing the simple statistical evaluations. You will need to implement a main program that reads the values into the array (or you could write another method to read them in), then call each of the various methods that you will convert from your previous programming project. The following methods comprise the StatPackage. The function specifications are as follows: Your StatPackage will accept up to 500 values as...
You are working as a software developer for a large insurance company. Your company is planning...
You are working as a software developer for a large insurance company. Your company is planning to migrate the existing systems from Visual Basic to Java and this will require new calculations. You will be creating a program that calculates the insurance payment category based on the BMI score. Your Java program should perform the following things: Take the input from the user about the patient name, weight, birthdate, and height. Calculate Body Mass Index. Display person name and BMI...
You are the CEO of a small company that sells transportation and logistics software. Your company...
You are the CEO of a small company that sells transportation and logistics software. Your company has not been doing well because of competition from larger rivals. You learn of a lucrative opportunity to sell licenses of your software to the Lackria Department of Transportation, a government agency of the nation of Lackria. Closing the deal could save your company from bankruptcy. In an impulsive moment, you meet with a Lackrian government minister and offer her ownership of a luxury...
As the Financial Controller of your company, you have been tasked to present a proposal to...
As the Financial Controller of your company, you have been tasked to present a proposal to the Board of Directors of your company for consideration.   Your proposal must address the following; a.      The negative impact of the COVID 19 pandemic on the operations of hospitality firms, justifying why your firm needs a stimulus package from the government?   Your arguments should be situated within the hospitality industry in Ghana. And again with your understanding of lessons on capital structure, which other...
21. Currently, you own 2,360 common shares of a company. The company will provide a dividend...
21. Currently, you own 2,360 common shares of a company. The company will provide a dividend of $1.74 per share next year, no dividend in two years from today, and a liquidating dividend of $37.80 per share in three years from today. The require return on the common shares is 9.01%. You want a total cash flow of just $680 next year and will use any excess received to buy more shares of the company. How much total dividends will...
You are working as a software developer for a large insurancecompany. Your company is planning...
You are working as a software developer for a large insurance company. Your company is planning to migrate the existing systems from Visual Basic to Java and this will require new calculations. You will be creating a program that calculates the insurance payment category based on the BMI score.Your Java program should perform the following things:Take the input from the user about the patient name, weight, birthdate, and height.Calculate Body Mass Index.Display person name and BMI Category.If the BMI Score...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT