CIS123_1
.docx
keyboard_arrow_up
School
ECPI University, Greensboro *
*We aren’t endorsed by this school
Course
123
Subject
Computer Science
Date
Jan 9, 2024
Type
docx
Pages
2
Uploaded by corada5995
£ C15123_1.6_Guided_Practice_ File Edit Program Tools Help Bl M Program has finished running. ate_First_Flowgorithm_Corey 2 - Main'% @Q% Dg % 5 Console RQ S d®H o >IN E ! | Please enter a whole number: | Please enter a whole number: The result of 4 times 5 is: 20 BB
4 IDLE Shell 3.9.2 - O X File Edit Shell Debug Options Window Help Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Corey/OneDrive - ECPI University/CIS123/CIS123_1.6_Guided Pr actice_First_Python_Program Corey Adams.py Please enter a whole number: 4 Please enter a second whole number:5 The result of 4 times 5 is: 20 >>> Ln:8 Col:4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Given Files:
selection.h
#ifndef SELECTION_H
#define SELECTION_H
#include <cstddef>
int select(size_t k, const int* list, size_t N);
#endif // SELECTION_H
selection.cpp
#include <stdexcept>
#include "selection.h"
int select(size_t k, const int* list, size_t N) {
// TODO(student): solve the selection problem
}
arrow_forward
Doubly Linked List
This assignment asks you to sort the letters in an input file and print the sorted letters to an output file (or standard output) which will be the solution. Your program, called codesolve, will take the following command line arguments:
% codesolve [-o output_file_name] input_file_name
Read the letters in from the input file and convert them to upper case if they are not already in uppercase. If the output_file_name is given with the -o option, the program will output the sorted letters to the given output file; otherwise, the output shall be to standard output.
In addition to parsing and processing the command line arguments, your program needs to do the following:
You need to construct a doubly linked list as you read from input. Each node in the list will link to the one in front of it and the one behind it if they exist. They will have NULL for the previous pointer if they are first in the list. They will have NULL for the next pointer if they are last in the…
arrow_forward
Directions:
Use a file city.txt for answering the questions that follow each scheduling algorithm. This file
has three columns (comma separated): the first column contains the job Id, the second column
indicates the CPU burst, and column three is the arrival time of the corresponding job.
Parallel Programming
It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get one.
Vaccines are available from six different brands and you have been entrusted to write a
program to count the total number of vaccines of each brand administered across 21 cities
in the state. Write a multithreaded program (in the file vaccines.cpp) that counts the number
of vaccines in 21 different files of numbers. Each line in each of the files will contain either
one of the following brand names: v1, v2, v3. Your program must count the number of units
for each vaccine brand administered, across all 21 cities, and display the total number of
units for each brand. The files are named "city1.txt",…
arrow_forward
Directions:
Use a file city.txt for answering the questions that follow each scheduling algorithm. This file has three columns (comma separated): the first column contains the job Id, the second column indicates the CPU burst, and column three is the arrival time of the corresponding job.
Parallel Programming
It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get one. Vaccines are available from six different brands and you have been entrusted to write a program to count the total number of vaccines of each brand administered across 21 cities in the state. Write a multithreaded program (in the file vaccines.cpp) that counts the number of vaccines in 21 different files of numbers. Each line in each of the files will contain either one of the following brand names: v1, v2, v3. Your program must count the number of units for each vaccine brand administered, across all 21 cities, and display the total number of units for each brand. The files are named…
arrow_forward
Custom Test incomplete
Delete the wages.csv file
Custom TestIncomplete
The program writes to the wages.csv file
Test OutputJohn Henry's payrate was not found in the wages.csv file. Traceback (most recent call last): File "/home/nt-user/workspace/nt-test-76ce7b1d", line 23, in <module> raise AssertionError() AssertionError
Test Contentsimport csv import main with open('/home/nt-user/workspace/wages.csv') as f: # Read in the CSV file csvfile = csv.reader(f) csvout = list() all_lines = list() for row in csvfile: csvout.append(row) # Create a single list of file contents for lyst in csvout: all_lines.append(lyst[0]) all_lines.append(lyst[1]) # Check the aggregated file contents for the employee information if 'John Henry' not in all_lines: print('John Henry was not found in the wages.csv file.') raise AssertionError() elif '570' not in all_lines: print('John Henry\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Maria Gray' not in…
arrow_forward
I have started on this but now I need help with getting the rest to work
MUST ADD SAVE COMMAND
Please Implement your changes into the code I have provided in the link below
[This is the link to what I have so far]
https://onlinegdb.com/3-ExO0R3r
arrow_forward
* Question Completion Status:
exception
Od.
QUESTION 8
When the arguments in a function must be in the same order the parameters were written, we use
arguments.
O a. positional
Default Values
Ob.
OC. Argument
O d. Keyword
QUESTION 9
Use the
method to delete any whitespace exists at the left end of a string
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
DELL
F5
F6
F7
F8
F9
F10
F11
F12
PrtSc
50
arrow_forward
There is a code below this template. The template must be implemented into the code but I am unable to run the code whenever I try to implement the code. How do I inmplement the template into the code?
// -- brief statement as to the file’s purpose
//XXXX-XXX- ADD YOUR SECTION NUMBER
// //Include statements
#include <iostream>
#include <string>
using namespace std;
//Global declarations: Constants and type definitions only -- no variables
//Function prototypes
int main()
{
//In cout statement below SUBSTITUTE your name and lab number
cout << "Your name -- Lab Number" << endl << endl;
//Variable declarations
//Program logic
//Closing program statements
system("pause");
return 0;
}
//Function definitions
Code:
#include <iostream> // Defining a header file
#include <string> // Defining a header file
using namespace std;
//Enum planetType
enum planetType {
Mercury, Venus,
Earth, Moon,
Mars, Jupiter,
Saturn, Uranus,
Neptune, Pluto };
//…
arrow_forward
This class prints the first several lines of a file. The default is to print 5 lines, but the -n flag can specify a different number. If no file is specified on the command line, read from standard input. The code bekoow is to help get started.
#include <stdio.h>
#include <stdlib.h>
// You may assume that lines are no longer than 1024 bytes
#define LINELEN 1024
static void usage (void);
int
main (int argc, char *argv[])
{
return EXIT_SUCCESS;
}
static void
usage (void)
{
printf ("head, prints the first few lines of a file\n");
printf ("usage: head [FLAG] FILE\n");
printf ("FLAG can be:\n");
printf (" -n N show the first N lines (default 5)\n");
printf ("If no FILE specified, read from STDIN\n");
}
arrow_forward
←
C
CCDConnect < C. X
.
M3 Assignment X w Word
https://mycourses.cccs.edu/d21/le/content/83491/viewContent/6197953/View
.
Dashboard - CCD x
●
X
w Hands On Assign X
Requirements for Your M3 Assignment 1 Pseudocode & Python with Iteration
Complete a program in pseudocode and Python that performs the following tasks.
• Download the file called M3Lab1_student.txt linked to your computer.
Open M3Lab1_student.txt in IDLE.
• Save it with the name M3Lab1ii.py. Replace ii with your initials. [example for someone with the initials cc: M3Lab1cc.py]
Complete Steps 1-6 within the code's comments.
• Run your program, enter your name, and guess at least 3 numbers.
• After you win a few times, take a screenshot of your program's output.
• Save your pseudocode as M3Lab1ii.docx. Replace ii with your initials.
• Insert a screenshot of your program output in the pseudocode's Word file.
How to Complete Your M3 Assignment 1 Pseudocode & Python with Iteration
• Write your pseudocode and save it as…
arrow_forward
IN PYTHON LANGUAGE
arrow_forward
The function print_last_line in python takes one parameter, fname, the name of a text file. The function should open the file for reading, read the lines of the file until it reaches the end, print out the last line in the file, report the number of lines contained in the file, and close the file.
Hint: Use a for loop to iterate over the lines and accumulate the count.
For example:
Test
Result
print_last_line("wordlist1.txt")
maudlin The file has 5 lines.
arrow_forward
>> classicVinyls.cpp
For the following program, you will use the text file called “vinyls.txt” attached to this assignment. The file stores information about a collection of classic vinyls.
The records in the file are like the ones on the following sample:
Led_Zeppelin Led_Zeppelin 1969 1000.00
The_Prettiest_Star David_Bowie 1973 2000.00
Speedway Elvis_Presley 1968 5000.00
Spirit_in_the_Night Bruce_Springsteen 1973 5000.00
…
Write a declaration for a structure named vinylRec that is to be used to store the records for the classic collection system. The fields in the record should include a title (string), an artist (string), the yearReleased (int), and an estimatedPrice(double).
Create the following…
arrow_forward
I have started on this but now I need help with getting the rest to work
MUST ADD SAVE COMMAND THAT MAKES A FILE
Please Implement your changes into the code I have provided in the link below
[This is the link to what I have so far]
https://onlinegdb.com/oNuCEgnua
arrow_forward
BinaryFileRead.cpp
// BinaryFileRead.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int *arrayToSort;
char fileName[50];
int size,readVal;
cout << "Enter a filename to sort => ";
cin >> fileName;
FILE *inFile;
fopen_s(&inFile,fileName, "rb");
fread(&size, sizeof(size), 1, inFile);
arrayToSort = new int[size];
for (int i = 0; i < size; i++) {
fread(&readVal, sizeof(readVal), 1, inFile);
arrayToSort[i] = readVal;
}
fclose(inFile);
return 0;
}
Timing.cpp
// Timing.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
#include <iostream>
#include <time.h> //ctime
#include <sys/timeb.h> //_timeb _ftime_s
using namespace std;
int main()
{
struct _timeb timebuffer;
char timeline[26];
_ftime_s(&timebuffer);
ctime_s(timeline,sizeof(timeline), &(timebuffer.time));
printf("The time is %.19s.%hu %s", timeline,…
arrow_forward
5..data
count DWORD?
.code
mov ax, 5
mov ecx,2
mov count,ecx
inc ax
mov ecx,3
L2:
dec ax
call dumpregs
loop L2
mov ecx,count
loop L1
Given the above code
After execution the ax value is *
5
arrow_forward
The starter file:
def main():# Add code that reads the file n_pets.txt,# computes the total number of pets,# the average #, the minimum #, and the maximum ## and displays those numbers as specified in the instructions.main()
The data file:
24632341355114422
arrow_forward
Music App
1. practise file I/O and exception handling;
2. practise String processing.
Aim:
Task: Create a Java application that transcripts a simple song score sheet.
The program asks user for filename of a text file that contains a simple song score sheet in this format:
Sample song score sheet 1, song1.txt:
#simple song with assumed time signature = 4
d1mls202s 1mld2o2
d1rimlfls 301s1f1m1rld4
Lines beginning with a hash #' is a comment line. A song contains one or more lines of musical
notes, d, r, m, f, s, l, tand also o meaning "Off" or rest. Each single character note is
followed by a single digit integer in [1 – 4], denoting the duration of the note in number of beats.
After transcription, the program outputs the melody on the screen as well as to another text file:
Melody output 1, on screen AND in melody_song1.txt:
#simple song with assumed time signature
Do Me So- Off- So Me
Do Re Me Fa| So-- Off
= 4
Do- Off- |
So Fa Me Re Do---
|
The default time signature is 4 beats per…
arrow_forward
Java
arrow_forward
IN C++
Comp Sci 203
Write a program that will copy columns "Feeder" ,"Time Open", and "Time Close"
to an existing CSV file called "Feeder Report"
arrow_forward
This code has still errors.
arrow_forward
Directions:
Typing make at the command line should create executable named bitflip.
Only bitflip.c and Makefile are included in the input unless permission is given for any other files.
Program should have consistent indentation.
Code should be readable with good variable and function names.
No use of "break or continue statements" except in a switch.
Program must exit with a return code of 0 on success and an error code in other cases.
The program used getopt to parse the command line.
Whenever an error occurs on the command line the user is given the usage statement and an appropriate error message if needed.
If the -o option is used the output will go to a file named as specified without changing the filename at all otherwise it will go to stdout.
-e option works as specified using bitwise operations.
-f option works as specified using bitwise operations.
-a option works as specified using bitwise operations.
-s option works as specified using bitwise operations.
Program outputs…
arrow_forward
Directions:
Typing make at the command line should create executable named bitflip.
Only bitflip.c and Makefile are included in the input unless permission is given for any other files.
Program should have consistent indentation.
Code should be readable with good variable and function names.
No use of "break or continue statements" except in a switch.
Program must exit with a return code of 0 on success and an error code in other cases.
The program used getopt to parse the command line.
Whenever an error occurs on the command line the user is given the usage statement and an appropriate error message if needed.
If the -o option is used the output will go to a file named as specified without changing the filename at all otherwise it will go to stdout.
-e option works as specified using bitwise operations.
-f option works as specified using bitwise operations.
-a option works as specified using bitwise operations.
-s option works as specified using bitwise operations.
Program outputs…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Related Questions
- Given Files: selection.h #ifndef SELECTION_H #define SELECTION_H #include <cstddef> int select(size_t k, const int* list, size_t N); #endif // SELECTION_H selection.cpp #include <stdexcept> #include "selection.h" int select(size_t k, const int* list, size_t N) { // TODO(student): solve the selection problem }arrow_forwardDoubly Linked List This assignment asks you to sort the letters in an input file and print the sorted letters to an output file (or standard output) which will be the solution. Your program, called codesolve, will take the following command line arguments: % codesolve [-o output_file_name] input_file_name Read the letters in from the input file and convert them to upper case if they are not already in uppercase. If the output_file_name is given with the -o option, the program will output the sorted letters to the given output file; otherwise, the output shall be to standard output. In addition to parsing and processing the command line arguments, your program needs to do the following: You need to construct a doubly linked list as you read from input. Each node in the list will link to the one in front of it and the one behind it if they exist. They will have NULL for the previous pointer if they are first in the list. They will have NULL for the next pointer if they are last in the…arrow_forwardDirections: Use a file city.txt for answering the questions that follow each scheduling algorithm. This file has three columns (comma separated): the first column contains the job Id, the second column indicates the CPU burst, and column three is the arrival time of the corresponding job. Parallel Programming It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get one. Vaccines are available from six different brands and you have been entrusted to write a program to count the total number of vaccines of each brand administered across 21 cities in the state. Write a multithreaded program (in the file vaccines.cpp) that counts the number of vaccines in 21 different files of numbers. Each line in each of the files will contain either one of the following brand names: v1, v2, v3. Your program must count the number of units for each vaccine brand administered, across all 21 cities, and display the total number of units for each brand. The files are named "city1.txt",…arrow_forward
- Directions: Use a file city.txt for answering the questions that follow each scheduling algorithm. This file has three columns (comma separated): the first column contains the job Id, the second column indicates the CPU burst, and column three is the arrival time of the corresponding job. Parallel Programming It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get one. Vaccines are available from six different brands and you have been entrusted to write a program to count the total number of vaccines of each brand administered across 21 cities in the state. Write a multithreaded program (in the file vaccines.cpp) that counts the number of vaccines in 21 different files of numbers. Each line in each of the files will contain either one of the following brand names: v1, v2, v3. Your program must count the number of units for each vaccine brand administered, across all 21 cities, and display the total number of units for each brand. The files are named…arrow_forwardCustom Test incomplete Delete the wages.csv file Custom TestIncomplete The program writes to the wages.csv file Test OutputJohn Henry's payrate was not found in the wages.csv file. Traceback (most recent call last): File "/home/nt-user/workspace/nt-test-76ce7b1d", line 23, in <module> raise AssertionError() AssertionError Test Contentsimport csv import main with open('/home/nt-user/workspace/wages.csv') as f: # Read in the CSV file csvfile = csv.reader(f) csvout = list() all_lines = list() for row in csvfile: csvout.append(row) # Create a single list of file contents for lyst in csvout: all_lines.append(lyst[0]) all_lines.append(lyst[1]) # Check the aggregated file contents for the employee information if 'John Henry' not in all_lines: print('John Henry was not found in the wages.csv file.') raise AssertionError() elif '570' not in all_lines: print('John Henry\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Maria Gray' not in…arrow_forwardI have started on this but now I need help with getting the rest to work MUST ADD SAVE COMMAND Please Implement your changes into the code I have provided in the link below [This is the link to what I have so far] https://onlinegdb.com/3-ExO0R3rarrow_forward
- * Question Completion Status: exception Od. QUESTION 8 When the arguments in a function must be in the same order the parameters were written, we use arguments. O a. positional Default Values Ob. OC. Argument O d. Keyword QUESTION 9 Use the method to delete any whitespace exists at the left end of a string Click Save and Submit to save and submit. Click Save All Answers to save all answers. DELL F5 F6 F7 F8 F9 F10 F11 F12 PrtSc 50arrow_forwardThere is a code below this template. The template must be implemented into the code but I am unable to run the code whenever I try to implement the code. How do I inmplement the template into the code? // -- brief statement as to the file’s purpose //XXXX-XXX- ADD YOUR SECTION NUMBER // //Include statements #include <iostream> #include <string> using namespace std; //Global declarations: Constants and type definitions only -- no variables //Function prototypes int main() { //In cout statement below SUBSTITUTE your name and lab number cout << "Your name -- Lab Number" << endl << endl; //Variable declarations //Program logic //Closing program statements system("pause"); return 0; } //Function definitions Code: #include <iostream> // Defining a header file #include <string> // Defining a header file using namespace std; //Enum planetType enum planetType { Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto }; //…arrow_forwardThis class prints the first several lines of a file. The default is to print 5 lines, but the -n flag can specify a different number. If no file is specified on the command line, read from standard input. The code bekoow is to help get started. #include <stdio.h> #include <stdlib.h> // You may assume that lines are no longer than 1024 bytes #define LINELEN 1024 static void usage (void); int main (int argc, char *argv[]) { return EXIT_SUCCESS; } static void usage (void) { printf ("head, prints the first few lines of a file\n"); printf ("usage: head [FLAG] FILE\n"); printf ("FLAG can be:\n"); printf (" -n N show the first N lines (default 5)\n"); printf ("If no FILE specified, read from STDIN\n"); }arrow_forward
- ← C CCDConnect < C. X . M3 Assignment X w Word https://mycourses.cccs.edu/d21/le/content/83491/viewContent/6197953/View . Dashboard - CCD x ● X w Hands On Assign X Requirements for Your M3 Assignment 1 Pseudocode & Python with Iteration Complete a program in pseudocode and Python that performs the following tasks. • Download the file called M3Lab1_student.txt linked to your computer. Open M3Lab1_student.txt in IDLE. • Save it with the name M3Lab1ii.py. Replace ii with your initials. [example for someone with the initials cc: M3Lab1cc.py] Complete Steps 1-6 within the code's comments. • Run your program, enter your name, and guess at least 3 numbers. • After you win a few times, take a screenshot of your program's output. • Save your pseudocode as M3Lab1ii.docx. Replace ii with your initials. • Insert a screenshot of your program output in the pseudocode's Word file. How to Complete Your M3 Assignment 1 Pseudocode & Python with Iteration • Write your pseudocode and save it as…arrow_forwardIN PYTHON LANGUAGEarrow_forwardThe function print_last_line in python takes one parameter, fname, the name of a text file. The function should open the file for reading, read the lines of the file until it reaches the end, print out the last line in the file, report the number of lines contained in the file, and close the file. Hint: Use a for loop to iterate over the lines and accumulate the count. For example: Test Result print_last_line("wordlist1.txt") maudlin The file has 5 lines.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT