Question

1. Write a program that contains an array. The array will contain the titles of your...

1.

Write a program that contains an array. The array will contain the titles of your favorite books,

games, shows, or movies. You may make it as large as you desire, but only enter the titles

through user input.

Sample output:

“Dragon Wing”, “Doom Patrol”, “Pokemon”, “Star Wars”

2.

Write a program that creates a class to represent what you spend your time on every week.

Inside of that class, you will need a 2D array that represents each day of the week and how

much time you spend on any given activity (the size should be 7 by whatever the number of

activities you perform in a week). You may enter the values however you like, but you will need

to display the array so that you understand your time management skills in a more concrete

manner.

Sample output:

0 2 4 2 4 0 0

This row could represent your hours spent

reading books.

0 5 4 1 1 0 2

This row could represent your hours spent going to

IN PYTHON PLEASE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1)

#Code.py
book = input("Enter book name: ")
game = input("Enter game name: ")
show = input("Enter show name: ")
movie = input("Enter movie name: ")
print(book, game, show, movie)

Answer 2)

n = int(input("Enter the number of activities performed in a week: "));
t = [];
s = [];
q = [0] * 7;
for i in range(n):
    print("Enter the activity", i, "to be performed in the week");
    ss = str(input(""))
    s.append(ss);
    print("Enter the time spent on", ss, "during each day of the week");
    for j in range(7):
        num = int(input(""));
        q[j] = num;
    t.append(q);


for i in range(n):
    print(t[i][0], t[i][1], t[i][2], t[i][3], t[i][4], t[i][5], t[i][6], end='');
    print(" This row represents time spent on", s[i]);
Add a comment
Know the answer?
Add Answer to:
1. Write a program that contains an array. The array will contain the titles of your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Java, write a program that contains an array. The array will contain the titles of...

    Using Java, write a program that contains an array. The array will contain the titles of your favorite books, games, shows, or movies. You may make it as large as you desire, but only enter the titles through user input. Sample output: “Dragon Wing”, “Doom Patrol”, “Pokemon”, “Star Wars” NOTE: Include step-by-step instructions in hidden notes.

  • Using Java, write a program that creates a class to represent what you spend your time...

    Using Java, write a program that creates a class to represent what you spend your time on every week. Inside of that class, you will need a 2D array that represents each day of the week and how much time you spend on any given activity (the size should be 7 by whatever the number of activities you perform in a week). You may enter the values however you like, but you will need to display the array so that...

  • Three C Code Questions: 5. Write a C program that declares an array of 10 strings,...

    Three C Code Questions: 5. Write a C program that declares an array of 10 strings, each of max length 50 characters, and then reads an entire line of text from the keyboard into each string. 6. Write C code that finds the longest name in this array of strings that you read in Q5. Hint: find the position of the longest string, not the string itself. 7. Write a C program that creates a 4 x 6 two dimensional...

  • Code in Java and implement (source code) a program (name it WeeklyHours) to compute the total...

    Code in Java and implement (source code) a program (name it WeeklyHours) to compute the total weekly hours for 3 employees. The program main method defines a two-dimensional array of size 3x7 to store employers’ daily hours for the week. Each row represents one employee and each column represent one day of the week such that column 0 designates Monday, column 1 designates Tuesday, etc. The program main method populates the array with random numbers between 0 and 10 and...

  • in java please Write a program that contains an array with all of your friends' first...

    in java please Write a program that contains an array with all of your friends' first names. Enter the values in any manner and order you choose (I recommend favorites first). Now take that array and sort it alphabetically so that names that start with ‘A' c me first. Look to see if you have any duplicates and if you find any, print out their names. You may use a binary search to determine this. 2. Sample output: Input list...

  • (C++ Program) 1. Write a program to allow user enter an array of structures, with each...

    (C++ Program) 1. Write a program to allow user enter an array of structures, with each structure containing the firstname, lastname and the written test score of a driver. - Your program should use a DYNAMIC array to make sure user has enough storage to enter the data. - Once all the data being entered, you need to design a function to sort the data in descending order based on the test score. - Another function should be designed to...

  • In C++ for 2D Array: Write a program that uses a function that manipulates a 2D...

    In C++ for 2D Array: Write a program that uses a function that manipulates a 2D array of integers as follows: 1. Fill the first row and column in the array with random bits 2. Every subsequent cell should be filled as follows: 1. If the cells that are to the left and top of it are equal, then you should store their sum in it b. Otherwise, your program should store the highest among them. Test your function using...

  • Class Average Create a program that dynamically creates an array whose size depends on the user's...

    Class Average Create a program that dynamically creates an array whose size depends on the user's preference. Pass the array to a calculate_avg function that is responsible for computing the average GPA of the given array. Use pointer arithmetic throughout your program. calculate_avg Create a function called calculate_avg that calculates the average of a double array and returns that average. calculate_avg() will have two parameters: a double* referring to the array an int that contains the size of the given...

  • Write a C++ program that uses a two dimensional array to display a table of probabilities...

    Write a C++ program that uses a two dimensional array to display a table of probabilities for a pair of rolling dice. Your custom assigned range of values of each die are: 5 up to and including 10. Section 1 of Program - Specifications: The top row of the table, left to right, and the left column of the array, top to bottom, must contain the assigned range of values displayed on each of the die in ascending order populated...

  • JAVA program For this project you are to create an array of objects of your choice...

    JAVA program For this project you are to create an array of objects of your choice using java your Driver Class, Object Classes should all be named appropriately depending on what Classes and Objects you decide to create for this assignment. This project must give the user the ability to view and to change the elements of the array. Print your results (output) as a clear and informative statement. Your output should also include an explanation of what your program...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT