Assignment For this assignment youll be creating a Bubble Sort algorithm This algorithm is

Assignment: For this assignment, you'll be creating a Bubble Sort algorithm. This algorithm is capable of taking a list of numbers and placing them in order, however it is also known as one of the least efficient means of doing so. For your assignment, you'll need to not only sort the given input (and display it in its final sorted form) but you'll also need to keep track of how many comparisons and reassignments happen. So, comparing two numbers will be counted as a SINGLE action. Swapping the location of two variables will meanwhile be considered THREE actions - one to store a variable to be swapped in a temporary storage location, another to swap the first of the variables to the second location, and a third to move the variable from the temporary storage location back to where it's going to go. To summarize, comparing two objects in the array will count as ONE action, and swapping two objects in the array will count as THREE actions. Your results should not only display the sorted version of the array but also a count of the total number of actions that took place while sorting. Please sort the following three lists: {1,3,7,5,2,4,6,8,9,10} {10,9,8,7,6,5,4,3,2,1} {1,10,2,9,3,8,4,7,5,6} An example output might look like: Sorted List: (1,2,3,4,5,6,7,8,9,10) 124 Actions Performed. (100 pts total: 40 points for code, 20 points for each sorted list plus action count)

Assignment: For this assignment, you’ll be creating a Bubble Sort algorithm. This algorithm is capable of taking a list of numbers and placing them in order, however it is also known as one of the least efficient means of doing so. For your assignment, you’ll need to not only sort the given input (and display it in its final sorted form) but you’ll also need to keep track of how many comparisons and reassignments happen. So, comparing two numbers will be counted as a SINGLE action. Swapping t

Read More

Enter two positive integer numbers First number must be less than the second number you enter

Write a program that uses while loops to perform the following steps. a. Create a user-defined function called Validate_User_Input() to prompt the user to input two positive integers and validate the user's input. Validate_User_Input() is a value returning function; doesn't accept any arguments and returns First_Num and Second_Num. Variables: First_Num and Second_Num (First_Num must be less than Second_Num). (use while loop to validate and repeat).b. Create a user-defined function called Odd_Numbers() to output all odd numbers between First_Num and Second_Num (use while loop). Odd_Numbers() is a void function; accepts First_Num and Second_Num as arguments and doesn't return any values.c. Create a user-defined function called Sum_Even_Numbers() to output the sum of all even numbers between First_Num and Second_Num (use while loop). Sum_Even_Numbers() is a value returning function; accepts First_Num and Second_Num as arguments and returns the sum of all even numbers. Declare a variable called Sum_Even in the main() to store the returned value from Sum_Even_Numbers().d. Create a user-defined function called Sum_Squre_Odd_Numbers() to output the sum of the square of the odd numbers between First_Num and secondNum (use while loop). Sum_Squre_Odd_Numbers() is a value returning function; accepts First_Num and Second_Num as arguments and returns the sum of the square of the odd numbers. Declare a variable called Sum_Square_Odd in the main() to store the returned value from Sum_Squre_Odd_Numbers(). e. Create a user-defined function called main() to repeat a program (use while loop) and execute the user-defined functions; Validate_User_Input(), Odd_Numbers(), Sum_Even_Numbers() and Sum_Squre_Odd_Numbers(). main() is a void function; doesn't accept any arguments. Program layout for each step. Include the comments in your code.#AValidate_User_Input() #BOdd_Numbers() #CSum_Even_Numbers() #DSum_Squre_Odd_Numbers() #Emain() #Executing Program.main() ***Allow the user to repeat the program. (requires another while loop).***Do NOT define any additional functions. Use only built-in functions that have been discussed in class.***Use only topics (Modules 01 - 07 and lecture) that were covered in class.***Your program output must be exactly the same as the output in the OUTPUT section, except font style.

Write a program that uses while loops to perform the following steps. a. Create a user-defined function called Validate_User_Input() to prompt the user to input two positive integers and validate the user’s input. Validate_User_Input() is a value returning function; doesn’t accept any arguments and returns First_Num and Second_Num. Variables: First_Num and Second_Num (First_Num must be less than Second_Num). (use while loop to validate and repeat).b. Create a user-defined function called Odd_

Read More

MatsRUs begintabularccc hline multicolumn1c Type Color Foldable 25

Create a Windows Forms application for Mats-R-Us Retailer. The app will determine the cost of a purchase based on amat type, color & whether or not it is foldable. .a. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines in the file(ProjectGuideline-Standards.pdf).b. If you want to include an image in the interface, you can use your own image.c. Prepare the following design specifications; Planning Chart and (pseudocode or flowchart.)d. Create a Windows Forms application. Use the following names for the project and solution, respectively:CalcCostProject for the project and MatsSolution.e. Use your Planning Chart as a guide when building the interface.f. Change the appropriate properties of the form. Properties updated or modified in Labs 1 - 4 will also beupdated/modified in lab 5.g. Add required internal documentation.h. Change the form file’s name to MainForm.vb. Change the form’s name to frmMain. Make sure to change thestartup form in project properties.i. The interface will 2 sets of radio buttons, a check box, a label, two buttons and an image if you choose.j. Be sure to set the tab order.k. The interface should allow the user to select the type & color, foldable option.l. Create a function that will determine the price based on the type selection using a select case statement.m. Create a procedure (not function) to determine the extra charge for color and foldable selected. Use IFstatements to determine the add on cost. Use ByRef in the procedure.n. Use a sales tax rate of 8.75% to obtain final price.o. Make sure declared constants follow location and naming rules.p. Clear the output labels by coding the CheckedChanged procedures.q. The application should display the cost of the purchase (2 decimal places).r. The form closing event will be used to determine if the user is sure they want to exit the application.s. The button that calculates and displays the cost should be the default button

Create a Windows Forms application for Mats-R-Us Retailer. The app will determine the cost of a purchase based on amat type, color & whether or not it is foldable. .a. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines in the file(ProjectGuideline-Standards.pdf).b. If you want to include an image in the interface, you can use your own image.c. Prepare the following design specifications; Planning Chart and (pseudocode or flowchart.)d. Create a Windows Forms ap

Read More

Program 1 scrabblepy Scrabble is a word game in which words are constructed from letter tiles

Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Table 1: Scrabble Point Value for Each Letter Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Your program should allow the user to enter multiple words as input until a stop word is detected. There should be at least two valid stop words, one of which should be a single letter shortcut. Ex: 'quit' and 'q'. Example Output: Python: PYTHON is worth 14 points. Druid: DRUID is worth 7 points. Ragnar: RAGNAR is worth 7 points. Vampire: VAMPIRE is worth 14 points. Daring: DARING is worth 8 points. i) quit

Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile’s points added to any points provided by the word’s placement on the game board. Table 1: Scrabble Point Value for Each Letter Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Your program should allow the user

Read More

Write a Python program to implement the New User Registration i Prompt the user who is doing

Write a Python program to implement the New User Registration: i. Prompt the user, who is doing registration, for entering a username and check its validity. ii. A valid username must be a string of length 8-12 and consists of: - at least 3 and at most 8 letters (a-z, A-Z) - at least 2 and at most 6 digits (0-9) - at most 1 underscore (_) iii. Prompt the user for entering a password and check its validity. iv. A valid password must be a string of length 10-16 and consist of: - at least one lowercase letter (a-z) - at least one uppercase letter (A-Z) - at least one digit (0-9) - at least one special character (@, #, %, &, $) v. If the username or password is not valid, inform the user of the specific requirements it does not fulfill (e.g., "A valid password must contain 10-16 characters", "A valid username must consist of at most 6 digits (0-9)"). vi. Prompt again and again until a valid username and a valid password are entered.

Write a Python program to implement the New User Registration: i. Prompt the user, who is doing registration, for entering a username and check its validity. ii. A valid username must be a string of length 8-12 and consists of: – at least 3 and at most 8 letters (a-z, A-Z) – at least 2 and at most 6 digits (0-9) – at most 1 underscore (_) iii. Prompt the user for entering a password and check its validity. iv. A valid password must be a string of length 10-16 and consist of: – at lea

Read More

Version 0 Get Started Unzip V0GetStartedzip into your Working Directory Doubleclick on the

Please help me in the following code in Python The tspAnalyze.py is below: The tspTest_v0.txt and tspTest_v1.txt is:"The travelling salesman problem (also called the traveling salespersonproblem or TSP) asks the following question: 'Given a list of cities andthe distances between each pair of cities, what is the shortest possibleroute that visits each city exactly once and returns to the origin city?'It is an NP-hard problem in combinatorial optimization, important intheoretical computer science and operations research."- Wikipedia Contributors, "Travelling salesman problem",Wikipedia, The Free Encyclopedia, 10 October 2021.MAIN MENU0. Exit program1. Print database2. Limit dimension3. Plot one tourChoice (0-3)? 1NUM FILE NAME EDGE TYPE DIMENSION COMMENT 1 a280 EUC_2D 280 drilling problem (Ludwig) 2 ali535 GEO 535 535 Airports around the globe (Padberg/Rinaldi) 3 att48 ATT 48 48 capitals of the US (Padberg/Rinaldi) 4 att532 ATT 532 532-city problem (Padberg/Rinaldi) 5 bayg29 EXPLICIT 29 29 Cities in Bavaria, geographical distances (Groetschel,Juenger,Reinelt) 6 bays29 EXPLICIT 29 29 cities in Bavaria, street distances (Groetschel,Juenger,Reinelt) 7 berlin52 EUC_2D 52 52 locations in Berlin (Groetschel) 8 bier127 EUC_2D 127 127 Biergaerten in Augsburg (Juenger/Reinelt) 9 brazil58 EXPLICIT 58 58 cities in Brazil (Ferreira)10 brd14051 EUC_2D 14051 BR Deutschland in den Grenzen von 1989 (Bachem/Wottawa)11 brg180 EXPLICIT 180 Bridge tournament problem (Rinaldi)12 burma14 GEO 14 14-Staedte in Burma (Zaw Win)13 ch130 EUC_2D 130 130 city problem (Churritz)14 ch150 EUC_2D 150 150 city Problem (churritz)15 d1291 EUC_2D 1291 Drilling problem (Reinelt)16 d15112 EUC_2D 15112 Deutschland-Problem (A.Rohe)17 d1655 EUC_2D 1655 Drilling problem (Reinelt)18 d18512 EUC_2D 18512 Bundesrepublik Deutschland (mit Ex-DDR) (Bachem/Wottawa)19 d198 EUC_2D 198 Drilling problem (Reinelt)20 d2103 EUC_2D 2103 Drilling problem (Reinelt)21 d493 EUC_2D 493 Drilling problem (Reinelt)22 d657 EUC_2D 657 Drilling problem (Reinelt)23 dantzig42 EXPLICIT 42 42 cities (Dantzig)24 dsj1000 CEIL_2D 1000 Clustered random problem (Johnson)25 eil101 EUC_2D 101 101-city problem (Christofides/Eilon)26 eil51 EUC_2D 51 51-city problem (Christofides/Eilon)27 eil76 EUC_2D 76 76-city problem (Christofides/Eilon)28 fl1400 EUC_2D 1400 Drilling problem (Reinelt)29 fl1577 EUC_2D 1577 Drilling problem (Reinelt)30 fl3795 EUC_2D 3795 Drilling problem (Reinelt)31 fl417 EUC_2D 417 Drilling problem (Reinelt)32 fnl4461 EUC_2D 4461 Die 5 neuen Laender Deutschlands (Ex-DDR) (Bachem/Wottawa)33 fri26 EXPLICIT 26 26 Staedte (Fricker)34 gil262 EUC_2D 262 262-city problem (Gillet/Johnson)35 gr120 EXPLICIT 120 120 cities in Germany (Groetschel)36 gr137 GEO 137 America-Subproblem of 666-city TSP (Groetschel)37 gr17 EXPLICIT 17 17-city problem (Groetschel)38 gr202 GEO 202 Europe-Subproblem of 666-city TSP (Groetschel)39 gr21 EXPLICIT 21 21-city problem (Groetschel)40 gr229 GEO 229 Asia/Australia-Subproblem of 666-city TSP (Groetschel)41 gr24 EXPLICIT 24 24-city problem (Groetschel)42 gr431 GEO 431 Europe/Asia/Australia-Subproblem of 666-city TSP (Groetschel)43 gr48 EXPLICIT 48 48-city problem (Groetschel)44 gr666 GEO 666 666 cities around the world (Groetschel)45 gr96 GEO 96 Africa-Subproblem of 666-city TSP (Groetschel)46 hk48 EXPLICIT 48 48-city problem (Held/Karp)47 kroA100 EUC_2D 100 100-city problem A (Krolak/Felts/Nelson)48 kroA150 EUC_2D 150 150-city problem A (Krolak/Felts/Nelson)49 kroA200 EUC_2D 200 200-city problem A (Krolak/Felts/Nelson)50 kroB100 EUC_2D 100 100-city problem B (Krolak/Felts/Nelson)51 kroB150 EUC_2D 150 150-city problem B (Krolak/Felts/Nelson)52 kroB200 EUC_2D 200 200-city problem B (Krolak/Felts/Nelson)53 kroC100 EUC_2D 100 100-city problem C (Krolak/Felts/Nelson)54 kroD100 EUC_2D 100 100-city problem D (Krolak/Felts/Nelson)55 kroE100 EUC_2D 100 100-city problem E (Krolak/Felts/Nelson)56 lin105 EUC_2D 105 105-city problem (Subproblem of lin318)57 lin318 EUC_2D 318 318-city problem (Lin/Kernighan)58 lin318 EUC_2D 318 Original 318-city problem (Lin/Kernighan)59 nrw1379 EUC_2D 1379 1379 Orte in Nordrhein-Westfalen (Bachem/Wottawa)60 p654 EUC_2D 654 Drilling problem (Reinelt)61 pa561.tsp EXPLICIT 561 561-city problem (Kleinschmidt)62 pcb1173 EUC_2D 1173 Drilling problem (Juenger/Reinelt)63 pcb3038 EUC_2D 3038 Drilling problem (Junger/Reinelt)64 pcb442 EUC_2D 442 Drilling problem (Groetschel/Juenger/Reinelt)65 pla33810 CEIL_2D 33810 Programmed logic array (Johnson)66 pla7397 CEIL_2D 7397 Programmed logic array (Johnson)67 pla85900 CEIL_2D 85900 Programmed logic array (Johnson)68 pr1002 EUC_2D 1002 1002-city problem (Padberg/Rinaldi)69 pr107 EUC_2D 107 107-city problem (Padberg/Rinaldi)70 pr124 EUC_2D 124 124-city problem (Padberg/Rinaldi)71 pr136 EUC_2D 136 136-city problem (Padberg/Rinaldi)72 pr144 EUC_2D 144 144-city problem (Padberg/Rinaldi)73 pr152 EUC_2D 152 152-city problem (Padberg/Rinaldi)74 pr226 EUC_2D 226 226-city problem (Padberg/Rinaldi)75 pr2392 EUC_2D 2392 2392-city problem (Padberg/Rinaldi)76 pr264 EUC_2D 264 264-city problem (Padberg/Rinaldi)77 pr299 EUC_2D 299 299-city problem (Padberg/Rinaldi)78 pr439 EUC_2D 439 439-city problem (Padberg/Rinaldi)79 pr76 EUC_2D 76 76-city problem (Padberg/Rinaldi)80 rat195 EUC_2D 195 Rattled grid (Pulleyblank)81 rat575 EUC_2D 575 Rattled grid (Pulleyblank)82 rat783 EUC_2D 783 Rattled grid (Pulleyblank)83 rat99 EUC_2D 99 Rattled grid (Pulleyblank)84 rd100 EUC_2D 100 100-city random TSP (Reinelt)85 rd400 EUC_2D 400 400-city random TSP (Reinelt)86 rl11849 EUC_2D 11849 11849-city TSP (Reinelt)87 rl1304 EUC_2D 1304 1304-city TSP (Reinelt)88 rl1323 EUC_2D 1323 1323-city TSP (Reinelt)89 rl1889 EUC_2D 1889 1889-city TSP (Reinelt)90 rl5915 EUC_2D 5915 5915-city TSP (Reinelt)91 rl5934 EUC_2D 5934 5934-city TSP (Reinelt)92 si1032 EXPLICIT 1032 []93 si175 EXPLICIT 175 []94 si535 EXPLICIT 535 []95 st70 EUC_2D 70 70-city problem (Smith/Thompson)96 swiss42 EXPLICIT 42 42 Staedte Schweiz (Fricker)97 ts225 EUC_2D 225 225-city problem (Juenger,Raecke,Tschoecke)98 tsp225 EUC_2D 225 A TSP problem (Reinelt)99 u1060 EUC_2D 1060 Drilling problem problem (Reinelt)100 u1432 EUC_2D 1432 Drilling problem (Reinelt)101 u159 EUC_2D 159 Drilling problem (Reinelt)102 u1817 EUC_2D 1817 Drilling problem (Reinelt)103 u2152 EUC_2D 2152 Drilling problem (Reinelt)104 u2319 EUC_2D 2319 Drilling problem (Reinelt)105 u574 EUC_2D 574 Drilling problem (Reinelt)106 u724 EUC_2D 724 Drilling problem (Reinelt)107 ulysses16 GEO 16 Odyssey of Ulysses (Groetschel/Padberg)108 ulysses22 GEO 22 Odyssey of Ulysses (Groetschel/Padberg)109 usa13509 EUC_2D 13509 The file US.lat-long.Z can be found in the directory /doc/geography.110 vm1084 EUC_2D 1084 1084-city problem (Reinelt)111 vm1748 EUC_2D 1748 1784-city problem (Reinelt)MAIN MENU0. Exit program1. Print database2. Limit dimension3. Plot one tourChoice (0-3)? 3Number (EUC_2D)? 45Invalid (GEO)!!!MAIN MENU0. Exit program1. Print database2. Limit dimension3. Plot one tourChoice (0-3)? 3Number (EUC_2D)? 7See tspPlot.pngMAIN MENU0. Exit program1. Print database2. Limit dimension3. Plot one tourChoice (0-3)? 0

Please help me in the following code in Python The tspAnalyze.py is below: The tspTest_v0.txt and tspTest_v1.txt is:”The travelling salesman problem (also called the traveling salespersonproblem or TSP) asks the following question: ‘Given a list of cities andthe distances between each pair of cities, what is the shortest possibleroute that visits each city exactly once and returns to the origin city?’It is an NP-hard problem in combinatorial optimization, important intheoretical computer science

Read More