kyeilahj
25.03.2020 •
Computers and Technology
Write a perl program that reads from a file containing a list of names and then displays that list to a user. The program should then ask the user if they want to sign up on the list. If they say yes, then the program should get the name of the user and add it to the file containing the list of names. If the user does not want to sign up then the program should exit.
Solved
Show answers
More tips
- S Science and Technology How to Make a Homemade Smoker: The Ultimate Guide...
- S Society and Politics 10 Tips for Boosting Your Self-Esteem...
- C Computers and Internet How to Create a Folder on Your iPhone?...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
Answers on questions: Computers and Technology
- M Mathematics Please this is very urgent. I will mark brainliest. this is 9th grade...
- M Mathematics In this question, use CAN $1.00 = JA $72.00. 1) On a vacation in Canada, Steve used his credit card to buy a camera for CAN $25.00. What is the value of the camera...
- M Mathematics David rolls a fair dice 30 times. How many times would David expect to roll a number greater than 3?...
- M Mathematics Write the quadratic equation in general form. (x - 3)^ 2 = 0...
- M Mathematics Help pleaseeee helpp!!...
Ответ:
#!/usr/bin/perl
use warnings;
use strict;
my $file = 'File1';
my $name;
my %h = ( ansy => 'Yes', ansn => 'No' );
open(Handle, '>>$file') or die $!;
while(<Handle>){
print $_;
}
print "Do you want to enter your name ? \n";
my $answer = <STDIN>;
chomp $answer;
print "You have entered input as '$answer' \n" ;
my %h = ( ansy => 'Yes', ansn => 'No' );
if( $answer eq $h{ansy} ) {
# if condition is true then print the following
printf "Please enter your name ? \n";
my $answer1 = <STDIN>;
chomp $answer1;
printf "Your have entered '$answer1' and it will be added to list \n";
print Handle '$answer1';
} elsif( $answer eq $h{ansn} ) {
# if condition is true then print the following
printf "You have entered No and we will exit";
exit();
} else {
# if none of the above conditions is true
printf "please enter either Yes or No \n";
}
close(Handle);
Explanation:
Above Code will work as per requirements. File1 is the path of your file.
Ответ:
Allotment of resources to the running programs
Explanation:
Operating system is the software sectors of the computing device that helps in control and management of software, hardware and programming functions. It helps in allotment of requirements to same time or individually running programs through coordination.
Example-mac-OS, Linux,Microsoft Windows etc. Other options are incorrect because operating system is not activates in the computer unit for every single execution. It is a software unit and does not monitors program execution for same time period.