Answer:
Written in Python
filenm = input("File name: ")
myfile = open(filenm+".txt")
for i in range(10):
line = myfile.readline()
print(line)
print("End of file")
Explanation:
This line prompts user for file name
filenm = input("File name: ")
This line creates an instance of the file
myfile = open(filenm+".txt")
This line iterates through the 10 lines
for i in range(10):
This line reads the line
line = myfile.readline()
This line prints each line
print(line)
This line prints a message indicating that all possible lines have been printed
print("End of file")
Hey there!
I think it's either A or D
Hope this helps you a little!
Always remember, you are A Work Of Art!
- Nicole
Answer:
this solution was written in c programming language
Explanation:
#include <stdio.h>
int main(void)
{
int i, j, number;
/* ask user for numbers */
printf("Enter 5 numbers between 1 and 30: ");
/* repeat 5 times */
for (i = 0; i < 5; i++)
{
/* read in number */
scanf("%d", &number);
/* print that number of stars */
for (j = 0; j < number; j++)
{
printf("*");
}
/* bring cursor to next line */
printf("\n");
}
return 0;
}