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

  Create a separate test directory

Use jUnit to write thorough unit tests for the Phone and Employee classes. Do not put test code in the src directory, instead, create a separate test directory.

  Prepare the logic for a program which performs arithmetic

create the logic for a program that performs arithmetic functions. design the program to contain two numeric variables.

  Implement a query functionality to the catalogue

Implement a query functionality to the Catalogue. This will return a list of Albums that match a given criteria. We specify the criteria as a search rule (based on a very simple query language) that is executed against all the Genres and albums in..

  Write down a program to input widths of both hallways

Write down a program which prompts user to input widths of both hallways. The program then outputs length of longest pipe.

  Write pseudocode for worm moving toward apple

Worm is moving toward an apple. Each time it moves, worm cuts distance between itself and apple by its own body length until worm is close enough to enter the apple. Give pseudocode for this.

  Write a program in q basic that accept student name

Write a program in Q basic that accept a student name,score obtained in 5 course and compute the average score of the student and my program must display the name of the student

  Write program to instantiate objects of inherited classes

X-Y coordinate pairs for four endpoints of Quadrilateral. Write program which instantiates objects of the classes and outputs each object's area.

  Weekly demand for motorola cell phones at a retail store is

weekly demand for motorola cell phones at a retail store is normally distributed with a mean of 300 and a standard

  Create and save a document named design plan pdf

Use the document formatting outlined in the syllabus and create a heading called Design Plan

  Determines which numbers produce a happy sequence

Write a program that determines which numbers produce a happy sequence, within a series of test numbers

  Computer sales and repair store system

It is required to design a relational database system for a "realistic" application

  Write function template that accepts array

Write a function template arraySum () whihc accepts an array and number of values stored in it and returns sum of those values.

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