Programming Logic & Design Comprehensive
9th Edition
ISBN: 9781337669405
Author: FARRELL
Publisher: Cengage
expand_more
expand_more
format_list_bulleted
Question
error_outline
This textbook solution is under construction.
Students have asked these similar questions
Go to your main.py file.
On the first line, add a docstring explaining what your file does. Then, assign a variable called whole_num to the user’s input and cast it to an integer.
Next, print 10 underscores as the top border of the table.
On the first line print your whole number, then multiply your whole number by multiples of 2's till 10 and print that out.
Finally, print 10 underscores again for the bottom border of the table, as in step 3.
Run the file by using the python3 main.py command.
Write a class called listOddNumbers that prints the below picture. (Note: there is a single space between each number). Please show your code and copy and paste your console with the finished result.
Using comments within the code itself, can you provide an line by line explanation of the below JavaScript file? The file itself deals with WebGl and if that helps you.
Please and thank you
JavaScript file:
function mat2()
{
var out = new Array(2);
out[0] = new Array(2);
out[1] = new Array(2);
switch ( arguments.length ) {
case 0:
out[0][0]=out[3]=1.0;
out[1]=out[2]=0.0;
break;
case 1:
if(arguments[0].type == 'mat2') {
out[0][0] = arguments[0][0][0];
out[0][1] = arguments[0][0][1];
out[1][0] = arguments[0][1][0];
out[1][1] = arguments[0][1][1];
break;
}
case 4:
out[0][0] = arguments[0];
out[0][1] = arguments[1];
out[1][0] = arguments[2];
out[1][1] = arguments[3];
break;
default:
throw "mat2: wrong arguments";
}
out.type = 'mat2';
return out;
}
//----------------------------------------------------------------------------
function mat3()
{
// v = _argumentsToArray( arguments );
var out = new Array(3);
out[0] = new Array(3);
out[1] = new Array(3);
out[2] = new Array(3);…
Knowledge Booster
Similar questions
- please follow the instructions given in the screenshot very well also for the runners.txt file here are the stuffs that are written inside it so just copy and paste it inside your own runners.txt file and you dont need to do the step one portion just step 2 to 4, also add professional comments inside the c++ code using the // command thank you 1 Margaret Hamilton 5:002 Barbara Liskov 6:053 Ida Rhodes 6:004 Christopher Strachey 5:205 Edith Windsor 4:506 Peter Landin 5:407 Lynn Conway 4:508 Jon Hall 6:159 Lois Haibt 4:1510 Mary Ann Horton 5:0511 Audrey Tang 4:4512 Souradyuti Paul 6:1013 Jean Bartik 3:5514 Devavrat Shah 5:2015 Komeil Bahmanpour 5:5516 Maryam Sadeghi 4:3517 Babak Hodjat 5:5518 Ada Lovelace 3:4019 Lotfi Zadeh 5:5020 Divya Jain 4:3021 Alan Turing 3:4022 Grace Hopper 5:0523 Lata Narayanan 5:4524 Sugata Mitra 4:1525 Bill Gates 4:40arrow_forwardhelp me rewrite the code without using bufferReader pleasearrow_forwardYou are given a text file (Words.txt) containing 50 words that will be hard to make out because they have been littered with punctuation. Your task is to: • Create a new file called Words2.txt, from Words.txt, which contains all the strings from the previous file, with their position, but with all the punctuation removed. (You must create some sort of method that can loop through the words to do this, you are not allowed to use Regex Patterns) Hint: This might come in handy String punctuation = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; • You must find the first longest word that appears in the text file with their position retained as well as indicating the number of characters therein, the formatting for this can be seen in Table 1.arrow_forward
- Make the photo below into a grayscale using python. Let us assume that the photo below is located in a folder name 'pic' and the name of the photo is Bird.jpgCode for gray: def grayscale(image): for y in range(image.getHeight()): for x in range(image.getWidth()): (r, g, b) = image.getPixel(x, y) r = int(r * 0.299) g= int(g * 0.587) b = int(b * 0.114) lum = r + g + b image.setPixels(x, y, (lum, lum, lum))arrow_forwardusing linux or virtual machine: Give the complete command line to replace all the white spaces to colons and save it as sampleforcut.txt;arrow_forwardPLEASE ONLY USE <iostream> and <fstream> only haves comments with the program The course records are shown below: Each student has 4 assignments. 108194 9 10 10 10 197526 10 10 10 10 197008 10 10 0 10 197746 10 10 9 10 108154 10 0 10 9 Create an input file ‘CSassignments.txt’ using an editor such as Notepad++ with a student number, then a space, then four assignment marks on one line. The assignment marks are whole numbers and are separated by a space. Your C++ program will read from the file ‘CSassignments.txt’ and write to a second file ‘CSgrades.txt’ which includes the average of the student’s four assignments. e.g. 108194 9 10 10 10 9.75 Your C++ program should work with any number of…arrow_forward
- I am attempting to write a code that will allow me to loop through a series of FITS fies in a folder on my Desktop. This is what I have so far, but no plot as yet. I have included a picture of what the plot should look like after the looping process. import numpy as npimport matplotlib.pyplot as pltimport globfrom astropy.io import fitsfrom astropy.wcs import WCSfrom pathlib import Path%matplotlib inline%matplotlib widget plt.figure(figsize=(5,5))legends = [] def plot_fits_file(file_path): # used this data to test ---------- # lam = np.random.random(100) # flux = np.random.random(100) # -------------------- # below code will work when you have file # all the plot will be on single chart hdul = fits.open(file_path) data = hdul[1].data h1 = hdul[1].header flux = data[1] w = WCS(h1, naxis=1, relax=False, fix=False) lam = w.wcs_pix2world(np.arange(len(flux)), 0)[0] plt.plot(lam, flux) plt.ylim(0, ) plt.xlabel('RV[km/s]')…arrow_forwardhow to write a method thar reads in any csv file and extracts the data from the csv file into header and the remaining data using the csv module, and stores them in instance variables. also how to write a code to handle potential errors with file content for example empty file and file not foundarrow_forwardDo it fast. Put up screenshot run code alsoarrow_forward
- 5.code with screenshot?arrow_forwardRemove and print green in the list by using the pop() method with the list given below: colors = ["navy", "white", "red", "black", "green", "blue", "red"] Just make sure to precisely match the output format below.Write your code in the ANSWER area provided below (must include comments if using code is not covered in the course). Example Outputgreenarrow_forwardHi, Im not sure this is working as intended, when selecting through the user option menu, like 1, then typing Onions, it displays 0, even though there are multiple instances of onions in the text file.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L