Programming Homework Help

Programming Homework Help. UH Downtown Phyton Spyder Code Simulate a Slot Machine Question

Can you help me understand this Python question?

Question 1

You python code will simulate a slot machine: it will generate a ticket of 3 random numbers. You need generate 1000 tickets. These 3 numbers must range from 1-9. When these three numbers are all 7s, or 9s, you win this game. Every time you won, print out ‘Bingo! You won!’

You must print out each ticket, then count how many times you had won, and print how many times you won at the end of the program.

Example output:

3 6 9

8 9 4

7 7 7

Bingo! You won!

8 9 5

9 9 9

Bingo! You won!

3 9 7

2 9 6

You won 2 times!

Question 2.

This question will focus on String manipulation.

We will have a default string like: A_Beautiful_Rose_Is_Blooming_In_The_Garden.

Each word is separated by a underscore char “_”.

You need to do following steps:

2.1 (5 pts) Split the sentence by unserscore “_”, and store them in a word list, print out that list

2.2 (5 pts) Change all letters of 1st word to upper case, the rest of the words all to lower case, then print the word list out

2.3 (5 pts) Join the word list back to a string using character “*”, print it out

2.4 (5 pts) Replace the word “rose” with your own favorite flower, daisy, gardenia, lily, tulip.

2.5 (5 pts) Reverse the new sentence and print them out

Sample output:

Please type a sentence: A_Beautiful_Rose_Is_Blooming_In_The_Garden.

2.1 output: [‘A’, ‘Beautiful’, ‘Rose’, ‘Is’, ‘Blooming’, ‘In’, ‘The’, ‘Garden.’]

2.2 output: [‘A’, ‘beautiful’, ‘rose’, ‘is’, ‘blooming’, ‘in’, ‘the’, ‘garden.’]

2.3 output: A*beautiful*rose*is*blooming*in*the*garden.

2.4 output: A*beautiful*tulip*is*blooming*in*the*garden.

2.5 output: .nedrag*eht*ni*gnimoolb*si*pilut*lufituaeb*A

Question 3.

Return the sum of the numbers in the array that are between 6 and 7. The first 6 should be excluded, and all 7’s should be excluded). Any number inside a 6 and 7 must be added to you sum, numbers outside of 6 and 7 should not be added.

Return 0 for no numbers.

Example output:

Sum67([])→ 0

sum67([1, 2, 2]) → 0

sum67([1, 6, 6, 10]) → 16

sum67([1, 6, 6, 10, 7]) → 16

sum67([1, 6, 6, 10, 7, 8, 7, 6, 1, 7, 7]) → 17

sum67([1, 1, 6, 7, 2]) → 0

Question 4.

This question focuses on Dictionary. We want to create a Dictionary to simulate the Hotel Booking list.

BookingNumber (int), Guest(String, firstname, lastname), RoomType(String, “suit”,“standard”), Price(Float), Date(String, “7/2-7/5”)

  1. Create an empty BookingDict Dictionary, it must be a global variable. (in main function)
  2. Define a function call createBooking(BookingNumber, Guest, RoomType, Price, Date). This function will add a new item to your BookingDict, with a Booking number that is an integer, and keeps increasing with each new book added.
  3. Define a function call sortBooking(). In this function, you will sort your Dictionary first based on the guest then by the Price.
  4. Call your createBooking function 5 Times to generate a BookingDict of 5 bookings. Display these five bookings.
  5. Call your sortBy functions to sort the BookingDict, then print out the sorted bookings.

Question 5.

Max Subarray Sum: Given an array of integers, find the subarray which contains max sum.

For example,

Input: Given integer array :”1, 2, 4, -6, 3, 4, -1, 9″,

Output: “16”

Input: Given integer array :”1, 2, 4, -9, 3, 4, -1, 9″,

Output: “15”

Input: Given integer array :”1, 2, 4, -6, 3, 4, -6, 5″,

Output: “7”

Input: Given integer array :”1, 2, 4, -6, 3, 4, -8, 9″,

Output: “9”

Divide and Conquer:

There are three key words:

  1. Find all subarrays
  2. Find the sum of this subarray
  3. Find the max sum and print it out

Programming Homework Help

Programming Homework Help

Programming Homework Help. Arizona State University Wk 5 High Level Database Models MySQL Task

1.Review the prompt and draw your diagram in MySQL.

Design an E/R diagram for a bank, including information about customers and their accounts. For the customers, keep the following information: name, address, phone, and social security number. For accounts, keep the following information: account number, type (saving, checking), and balance. Your diagram should show the ownership relation between a customer and an account. You should also show all primary keys in your diagram. When using the MySQL model, you can assume any appropriate datatype for each column.

2. Review the prompt and draw your diagram in MySQL.

Change your diagram in the previous question (#1) so that a customer can have a set of addresses that are street-city-state and a set of phones. You are not allowed to use nonprimitive datatype such as a set value. Therefore, you should add other entity sets appropriate for the new conditions. Please also show all primary keys for all entities and relationships (e.g. one-many).

3. Review the prompt and draw your diagram in MySQL.

Design a database for the university registrar. This database should include information about students, departments, professors, courses, which students are enrolled in which courses, which professor are teaching which courses, student grades, TA’s for a course (TA’s are students), which courses a department offers, and any other information you think is appropriate. In addition, consider the following assumptions in your design:

  • Each professor only works in one department.
  • A course has at most one TA.
  • A course is only taught by one professor and offered by one department.
  • Students and professors have been assigned unique email ids.
  • A course is uniquely identified by the course number, section number, and semester (e.g. cs220-1 spring 21).

You should also identify all the primary keys and relation types (e.g. one-many).

4. Consider the previous question (#3). Draw its UML diagram. You do not use MySQL for this question.

5. Review the prompt and draw your diagrams in MySQL.

Draw E/R diagrams for the following cases considering weak entity sets. In each case, indicate primary keys.

  1. For entity sets courses and departments, suppose that a unique department gives a course, but its only attribute is its number. Different departments can offer courses with the same number. Each department has a unique name.
  2. Consider entity sets leagues, teams, and players. League names are unique. No league has two teams with the same name. No team has two players with the same number. However, there can be players with the same numbers on different teams, and there can be teams with the same name in different leagues.

Programming Homework Help

Programming Homework Help

Programming Homework Help. COP 3084 Miami Dade College Comparing Sorting Algorithms Project

Challenge 5b – Comparing Sorting Algorithms

1.)  Use the attached skeleton  (I will put in comments the Zip file) and the attached PowerPoint (see below)

to write the driver class that has 3 methods that will accept an array of ints to sort using each of these algorithms:  insertion, selection, & bubble.  Note:  Make sure the sorting is in ASCENDING order!
 

2.)  Write a driver that will do the following:

a.)   Create an array of 20,000 ints (generate the numbers randomly in a loop, in the range of 1 – 5000)

b.)   Call each of the sorting methods, passing it the array of 20,000 ints (Note:  make a copy of the array before sorting the copy).

c.)   Calculate the number of nanoseconds taken to sort the same array, using each of the 3 algorithms.

d.)    Display the time for each.  Say which of the 3 algorithms was fastest (most efficient).

Hint #1: To prove that the algorithm is working, create a small array of 10 randomly generated ints between 1 and 100, and sort them using each of the 3 sorting methods, and print them after each sort. Make a copy of the original array, so that you are re-sorting an unsorted array, instead of the sorted array.  This is proof of concept.

Hint #2:  Make a copy of the original array, so that you use the unsorted version as input to each method.

Hint #3:  Use either System.currentTimeMillis() or System.nanoTime() to get the start and end time assigned to 2 long variables, then subtract, and that is your total time.

Extra Credit:  Do the same for mergeSort and quickSort.

____________________________________________________

Per the syllabus Requirements:

Assignments:

Each week, students will be assigned a CHALLENGE program, which will be started during the lab time, and must be completed and turned in via Canvas by midnight on Sunday. All programming assignments are required to be turned in as “zipped” Netbeans projects, so that the graders can have a consistent means of “unzipping” and testing the programs. 

Ensure your student id, section, and due date appear in the comments of your programming assignments, to give you proper credit. Do not put your name in the comments, since we use anonymous grading.

Programming Homework Help

Programming Homework Help

Programming Homework Help. Wilmington University Dog Hall of Fame Webpages

Part 1:

In Week 4, you styled the Dog Hall of Fame webpages. In this exercise, you will update

those pages to apply the principles of responsive design. Do the following activities

  1. Open the external style sheet you created in Week 4 and save it with the name css in the styles folder within the your class folder.
  2. Add your name and the current date as a comment to the first line of the dogstyles05.css file.
  3. Open the files you created for the Dog Hall of Fame in Chapter 4 in your HTML editor and make sure your name and the current date are added as a comment to the first line of all files.
  4. Modify the link to the external style sheet to reference dogstyles05.css.
  5. Decide what responsive design principles you want to employ. At a minimum, update the HTML and CSS files to do the following:
    1. Add the viewport meta tag.
    2. Create flexible images.
    3. Create a fluid layout.
    4. Determine the essential content for each page to be displayed for a mobile viewport.
    5. Design a navigation system suitable for a mobile viewport.
    6. Refine your style sheet as needed to add margins and padding using em units of measure.
  6. Save and test your files.

Part 2:

In Part 1 of this week lab, you styled the Dog Hall of Fame webpages for a mobile viewport. In this this part, you will update those pages to apply media queries for tablet and desktop viewports. Do the following activities:

  1. Open the external style sheet you created in part 1 and save it with the name css
  2. Add your name and the current date as a comment to the first line of the dogstyles06.css file
  3. Open the files you created for the Dog Hall of Fame in part 1 in your HTML editor and make sure your name and the current date are added as a comment to the first line of all files.
  4. Modify the link to the external style sheet to reference dogstyles06.css.
  5. Decide how you will design the tablet and desktop viewports. At a minimum, update the HTML and CSS files to do the following:
    1. Create a media query for tablet and desktop viewports.
    2. Create style rules for tablet and desktop viewports.
    3. Create style rules for pseudo-classes within the desktop viewport.
    4. Apply a gradient to the webpages in the tablet and desktop viewports.
    5. Hide the mobile class for the tablet and desktop viewports.
    6. Display the desktop class for the tablet and desktop viewports.
    7. Refine your style sheet as desired.
    8. Adjust viewport widths where necessary.
    9. Add comments to note all changes and updates.
  6. Save and test your files.
  7. Validate and correct your HTML and CSS files.

Programming Homework Help

Programming Homework Help

Programming Homework Help. Florida State College at Jacksonville Write a Program Computer Programming Task

Thread activity

  • Write a program that uses 5 threads. Initialize a shared variable with a value of 100.
  • Each thread must add its Thread ID (tid) to the shared variable.
  • Once a thread has done the addition, print the ID of the thread.
  • It is important to make use of mutexes so that only one thread is incrementing the shared variable at a time.
  • Output the value of the shared variable once all threads have finished incrementing it.

Programming Homework Help

Programming Homework Help

Programming Homework Help. CSCI 312 Davenport University Huffman Encoding Algorithm Program

I need help with the detailed instructions in bold below. I have attached the visual studio program code in word documents, it was the only I could get them to attach correctly. I need all of the questions below Deliverable answered for a multiple part project.


Design and implement a program that will compress and uncompress an ASCII text file
using the Huffman encoding algorithm of your own design. The use of third party
compression algorithms, APIs, or services is prohibited. The program must either
function from the command line or provide a graphical user interface.)
Please answer the question in bold that is listed below.


Deliverable

A single ZIP file that contains the following:
• A single detailed design document including the methodology, data structures, file
structures, and algorithms used to design and code the program
• A reproducible testing plan that encompasses the compress and decompression
operations, the input data, and the steps used to validate the results
• The source code
Detailed instructions on how to use the program

Programming Homework Help

Programming Homework Help

Programming Homework Help. Pasadena City College Dunkin Donuts Discussion

I’m working on a linux question and need an explanation and answer to help me learn.

Why does Dunkin’ Donuts put such a strong emphasis on the quality of the coffee?

Describe the role that marketing research plays at Dunkin’ Donuts.

  1. What sort of information does Dunkin’ Donuts consider when it’s determining where to locate a new store and why?’

Video: https://canvas.pasadena.edu/courses/1118587/files/70764323/download?download_frd=1

Programming Homework Help

Programming Homework Help

Programming Homework Help. INSY 3330 The University of Texas at Arlington Html CSS Question

INSY 3330 – Introduction to E-Commerce

HTML Assignment 1

Create a simple website about your favorite “Sport Team” or your favorite “TV Series.”

1. Go to https://glitch.com/ and start a new project by clicking on “New Project then glitch-hello-website” options.

2. Use the index.html file for the first part of your assignment (Don’t rename it).

3. Delete “Hello!” from the <head></head> part of your codeand add a short descriptive title in its place.

4. In the <body> element, delete “Hi there!” from the <h1> element and replace it with a heading that shows the main topic of the page.

5. Delete the text from the <p> element and replace it with text with a brief description (3 – 5 sentences).

6. Add another paragraph (<p>) element with 3 – 5 sentences explaining why you like that team or tv series.

7. Use an appropriate HTML tag to emphasize (bold) one main sentence or keyword in your description.

8. Search Google and find an appropriate HTML tag to add an underline to one sentence. Here is an example:

I’m a real fan of Manchester United Soccer Team.

9. Add a related image to your website. Adjust the width and height of the image (height=300px, width=400px)

10. Add a link to your page which provides more information about your favorite “Sport Team” or “TV Series”

11. (Extra Point) Can you add a small image to your page and make it as a link? (You should be able to click on the image and that direct you to a new page)

12. Add an “unordered list” to your site and name three or more players or actors/actresses that played main roles in your selected Sport Team or TV series. Example:

List of three main players in Man United:

Ruud van Nistelrooy

David Beckham

Ryan Giggs

13. Add a table to your web site and describe more about those individuals in your list. Here is an example: (Be creative you can have different headings in your work)

Player

History

Birth Date

Picture

Ruud van Nistelrooy

Ruud van Nistelrooy is a retired Dutch footballer and a current manager for the PSV youth team. A former striker, he is the

fourth- highest goalscorer in UEFA Champions League history with 56 goals.

July 1, 1976

14. Change the background color of the table to your desired color

15. Add at least one more element of your choosing (e.g., a paragraph, image, list, etc.)to make add more content/interest to the page.

16. Submit your webpage:

Click the Share button (upper-left corner of the page).

Click the Copy button to copy the URL.

Go to the assignment in Canvas and submit the URL through the link provided.

Programming Homework Help