Write a subroutine that keeps prompting for a filename

Assignment Help Programming Languages
Reference no: EM131002814

 Exercise 1 &2 

1.   Write a subroutine to prompt the user for any message (like "what is your name?"). The sub will collect the user's answer and return it back to the call (in the main program above the subroutine). Print out the returned string from the sub.

 

2.Write a subroutine that keeps prompting for a filename until a valid file is entered by the user (print out "file found, thanks") or until five attempts have failed (print out "you did not enter a valid file name"). Call the subroutine from the main part of your program. The sub in this case does not return any value. Show the entire program (not just the sub).

Perl Programming Language

Verified Expert

Complete Solution includes Ex1.pl is the solution to Exercise1 question. Ex2.pl is the solution to Exercise2 question. output-screenshots.doc contains output screen shots for above 2 programs

Reference no: EM131002814

Questions Cloud

Approach to modeling multicomponent transport : In Kerkhof and Geboers, (2005)7 , the authors presented a new approach to modeling multicomponent transport that is purported to yield more accurate predictions than previously available models.
Discuss the average size and deviation : You work for an organization that is concerned about automotive technologies. Discuss the average size and deviation for the top 5 and bottom 5, Average Wt and deviation for Top 5 and Average Wt and deviation for Bottom 5
Determine the postretirement benefit expense : Prepare the appropriate journal entries to record the postretirement benefit expense, funding, and retiree benefits for 2011.
True values of the unknown parameters : First, con?rm that the true values of the unknown parameters are θ0 = 1 and θ1 = 2, by computing for each indicated value of xi, the theoretical responses ηi given by:
Write a subroutine that keeps prompting for a filename : Write a subroutine that keeps prompting for a filename until a valid file is entered by the user (print out "file found, thanks") or until five attempts have failed (print out "you did not enter a valid file name"). Call the subroutine from the main ..
Describe two devices incandescent lamps and diodes : What does it mean for two variables, such as current and potential, to have a linear relationship to each other? Describe two devices "incandescent lamps and diodes" in which current and potential do not follow Ohm's Law.
Weighted least squares estimates : Determine the maximum likelihood estimates of the parameters θ0 and θ1 in the two-parameter model, η = θ0 + θ1x Show that these are also similar to weighted least squares estimates. What are the weights in this case?
Determine the net loss or gain as of december 31 : Calculate any amortization of the net loss that should be included as a component of postretirement benefit expense for 2011.
What is the focal length of the concave lens : The image is formed on a screen 18 cm from the lens. You then place the concave lens halfway between the convex lens and the screen. To obtain a sharp image, you need to move the screen 15 cm further away from the lenses. What is the focal length ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that uses the curve class hierarchy

Write a program that uses the curve class hierarchy. The program should define several different objects, output their area, circumference, etc. It should also use the printcurve function.

  Weka answer in the file i upload and do the best this

answer in the file i upload and do the best. this assignment would need use weka on last question. please follow

  Web design and object-oriented programming

Identify two differences between web design and object-oriented programming

  Write program to prints formatted table of windchill values

Write a program which prints nicely formatted table of windchill values. Rows must represent wind speed for 0 to 50 in 5 mph increments.

  Write a function that accepts an array a as input and

write a function that accepts an array a as input and searches the contents of the array for elements in three

  Creating class savingsaccount using static variable

Create class SavingsAccount. Use static variable annualInterestRate to store annual interest rate for all account holders.

  Write a program that reads in a single record

Write a program named printRecord.py that reads in a single record from the first logfile, prints it, and exits - Write the final version of your program; it does what merger.py does and then loops through the records accumulating the op costs. It t..

  Designing menu for administrator to simulate transmissions

Design a menu which permits administrator to simulate transmissions of information by manually typing in login or logoff data.

  Create security code program-display digit-ascii character

You have been hired to create the security code program. Program must permit user to enter message, one character at a time.

  Use one-dimensional array to read in twenty numbers

Use the one-dimensional array to solve problem: Read in 20 numbers, each of which is between 10 and 100. As each number is read, print it only if it is not duplicate of number which has already been read.

  Feature of object-oriented programming

Describe at least one (1) feature of object-oriented programming that Visual Logic lacks. Identify at least one (1) advantage to using event-driven programming, as compared to using purely procedural programming

  Develop two single dimension arrays-floating-point numbers

Develop two single dimension arrays which contain 10 floating-point numbers in each array. Develop third single dimension array to hold sum.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd