Write a program that asks the user for the name of a file. The program should display only the first five lines of the file’s contents. If the file contains less than five lines, it should display the file’s entire contents.function displayFileHead(fileToDisplay) {}var readlineSync = require('readline-sync');var fileToDisplay = readlineSync.question('What file would you like to see the first five lines from? ');displayFileHead(fileToDisplay);Yes, it is a homework assignment for those of you who are familiar with programming. I'm a finance major and I took the WRONG IT course for my MIS minor and I'm just looking for someone to help me properly code this.
Submitted April 19, 2019 at 09:41PM by Mag1c_M1k3
No comments:
Post a Comment