LAB Topic 1 F23
.docx
keyboard_arrow_up
School
Texas A&M University *
*We aren’t endorsed by this school
Course
102
Subject
Computer Science
Date
Jan 9, 2024
Type
docx
Pages
3
Uploaded by ProfLightning103643
Lab: Topic 1
ENGR 102 – Fall 2023
Lab: Topic 1
Deliverables:
This is an individual assignment, but you may consult your classmates and others as you work. You must
submit your own code. Please submit the following files. I suggest testing it in your preferred IDE first to
get the hang of things, then submit your working files to
zyBooks
.
howdy_world.py
print_math.py
follow_directions.py
Activity #1:
Howdy World – individual
Write a program named
howdy_world.py
that outputs:
A)
Howdy, World!
B)
One sentence giving some interesting fact about yourself
Example output:
Howdy, World!
I code in python for fun.
Activity #2:
Print math – individual
The purpose of this activity is to familiarize you with some basic engineering equations and provide
practice writing a simple Python program that performs calculations and displays results.
For the equations below, write code that will display the numerical result of using the equation with the
specified inputs. Notice that the inputs have units associated with them and that you will need to
interpret the result using the correct units. Please include comments in your code, as needed, to
describe what your code is doing.
Example
: Let’s say we want to compute the area of a rectangle of length 5 inches and height 3 inches.
The line of code below will print the numerical result.
Code:
print(5 * 3)
Output:
15
If that is all we include in the code and in the output, it will be extremely difficult for someone to
understand what the code does or to properly interpret the result. That someone may be the person
grading your work, or may be you if you look back at this code in a few weeks!
Note
: The code includes the line
print(5 * 3)
and not
print(15)
. We want to use a
mathematical expression inside the parentheses. You’ll understand why when we reuse this code in the
next lab assignment.
It’s good practice to use comments to document what your code is doing. You can also print out extra
information to make the output more meaningful and easier to read.
Based upon Dr. Keyser’s Original
1
Revised Fall 2023 SNR
Lab: Topic 1
New code:
# Calculate/print the area of a rectangle of length 5 in
# and height 3 in
print("Area of rectangle is", 5 * 3, "in^2")
New output:
Area of rectangle is 15 in^2
In the new version of the code, the first comment simply describes what the line of code below it does. It
is not printed to the screen. Next, three separate items of information are printed to the screen using
one
print()
statement:
1.
"Area of rectangle is"
– a description of the output value
2.
5 * 3
– the result of the mathematical operation
3.
"in^2"
– another string that indicates the units
Notice that these three items are separated by commas in the
print()
statement and that the
“strings” consist of text enclosed inside double quotation marks. By default, when print items are
separated by a comma, a space is inserted between the items when printed. If someone looks at this
code and the output, they should be able to tell what you are doing without having to ask too many
questions.
Write a program named
print_math.py
to produce output for the following calculations:
A)
Calculate the force in Newtons applied to an object with mass 27 kg and acceleration 1.5 m/s^2.
According to
Newton’s Second Law
the net force applied to an object produces a proportional
acceleration.
B)
Calculate the wavelength of x-rays scattering from a crystal lattice with a distance between
crystal layers of 0.025 nm, scattering angle of 35 degrees, and first order diffraction.
Bragg’s Law
describes the scattering of waves from a crystal using the equation
nλ
=
2
d
sin
θ
The standard unit of wavelength in the SI system is nanometers (nm).
C)
Calculate how much Radon-222 is left after 5 days of radioactive decay given an initial amount of
27 g and a half-life of 3.8 days. The equation for
radioactive decay
is
N
(
t
)
=
N
0
2
−
t
/
t
1
/
2
where
N
0
is the intial amount (units of grams),
t
is the time (units of
days), and
t
1
/
2
is the half-life (units of days).
D)
Calculate the pressure of 5 moles of an ideal gas with a volume of 0.27 m^3, and temperature of
415 K. The
Ideal Gas Law
is the equation of state of a hypothetical ideal gas and is a good
approximation of the behavior of gases under many conditions. Use a value of 8.314
m^3Pa/K·mol for the gas constant. The standard unit of pressure in the SI system is kilopascals
(kPa).
Example output:
Force is 40.5 N
Wavelength is 0.028678821817552304 nm
Radon-222 left is 10.846051558652912 g
Pressure is 63.89462962962962 kPa
Activity #3:
Follow directions – individual
The purpose of this activity is to get you used to zyBooks, and to learn to follow directions. You will
encounter limits of functions in calculus and learn to work with them analytically. Writing this program
Based upon Dr. Keyser’s Original
2
Revised Fall 2023 SNR
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
A-List
Objective:
At the end of the exercise, the students should be able to:
▪ Create an adjacency list in Java.
Software Requirements:
▪ NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
1. Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark)
2. Using NetBeans, create a Java project named AdjacencyList. Set the project location to your own
folder.
3. Create an adjacency list based on the given graph.
B
A
с
E
D
F
G
arrow_forward
Upload the code that will display if the user won or lost the round of hangman. It
should also prompt the user if they want to play another round of hangman.
1 Add file
Send me a copy of my response.
Submit
This form was created inside of Leanderisd.org. Report Abuse
arrow_forward
REact JS
Assignment: Create a Bulb component that can be switched On/Off on click of button (we covered this in class)Assignment: Create two bulbs (on click of btn turn anyone of it --red or green)Assignment: Add delete functionality to the Employee Table
arrow_forward
Move the appropriate file types from the list on the left to the correct descriptions on the right.
File Types (Icons)
XE
F
E
4
Answer Area
A file where you create the user interface
allowing you to display information and react to
user input.
A file that contains all the setup information for
your app.
A file that contains coded app logic.
A file that contains a list of available resources
to be used in the project.
arrow_forward
Create a simple program for a quiz bee.
Software Requirements:
Latest version of NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive.
2. Create a new project named LabExer5B. Set the project location to your own folder.
3. The program shall:
contain an array of 10 multiple choice questions with three (3) choices each and
require the user to choose among A, B, or C;
Note: Cases are ignored. Lowercase letters are acceptable (a, b, c).
4. Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the
following:
• an invalid letter (not A, B, or C)
• a number or any special character
• blank (no answer)
5. Prompt the user that he can answer again if any of the three (3) exceptions is thrown.
6. Display the score.
arrow_forward
Course Title : Operating SystemQuestion :
How you will create new user using terminal in Ubuntu? Add screenshots of all steps for new user creation including terminal and Login page in Answer sheet. Every student has to create new user as of his/her arid number for example (18-arid-2929).
Note: screenshots are mandatory.
arrow_forward
The Problems - contains only problems from the last 2 contests
Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The
Featured drop-down menu has different difficulty ranges so you can try problems that
best suit your experience.
Popular topics and brands Like most users, Chef didn't know that he could add
problems to his personal to-do list by clicking the magic "+" symbol in the upper
right corner of each problem page. But once he found out about it, he went crazy and
added a lot of problems to his to-do list without looking at their difficulty rating.
Rajesh is a beginner and ideally should only try to solve problems strictly below
10001000. Given the difficulty rating list of problems in Chef's to-do list, please help
him determine how many of these problems Chef should remove from his to-do list
so he is left with only problems with a difficulty rating of less than 10001000.
Note: Please answer the question in Python only:
Input
1
4
999 1000 1001 1002…
arrow_forward
add tags for these feature files with --tags option:
When you select scenarios by one tag
When you select scenarios that have one or another tag
When you select scenarios that have 2 tags
When you disable scenarios that have a specific tag
Given Scenarios:
Feature: Login functionalityBackground:Given a web browser is at the BrainBucket login pageScenario: user can't login without entering emailGiven User is not logged inWhen Password is enteredAnd User click Login buttonThen 'Warning: No match for E-Mail Address and/or Password' will be shownScenario: user can recover his passwordGiven User is not logged inWhen User clicks 'Forgotten Password' buttonAnd enters his emailThen Message 'An email with a confirmation link has been sent your email address.' will be dispalyed
arrow_forward
RISK REGISTER : CYBER SECURITY LAB (KEYLOGGING SOFTWARE). Please add 3 more risks.
Intructions: please see below.
1) Have your team identify the top 5-10 risks for your project (i.e. one of the computers don't work, the electrical system is overloaded when all the computers are on, a component of one of the computers is misplaced or stolen, etc.).
arrow_forward
Written Assignment #1: To submit your assignment, click on the Written Assignment #1 link above. This will take you to
a Preview Upload Assignment window. You'll need to scroll down to Assignment Submission. From here you can write a text
submission or select Browse My Computer and find your file.
Directions: Answer each of the following questions. Show your work or explain how you arrived at your conclusion whenever
appropriate. Use your calculator.
In a random sample of 175 community college students, the mean number of hours spent studying per week is 13.7 hours and
the standard deviation is 4 hours.
a) Find the standard score (z-score) for students who study the following hours in a particular week. Round Z to the nearest
hundredth and interpret the meaning of each answer as it pertains to this problem.
i) 22 hours
ii) 6 hours
b)Assuming the distribution of the number of hours community college students study per week is normally distributed,
approximately how many of the students…
arrow_forward
General Description
For this assignment, you will read and process historical stock data for the Tesla company.
Project Setup and Structure
Create a new java project in Eclipse and call it homework01.
Inside the src folder, create a new java package called hw01.
All your source code files will need to be placed in the hw01 file.
Inside the src folder, create a new folder called files.
Your .csv files should go in files.
NOTE: When working with the .csv file, your program must use a relative path to the .csv file, NOT an absolute path.
TeslaStock Class
Create a class called TeslaStock. This class will be used to represent each stock's data in your project. This class should not contain any methods to read/write the data. Only implement the following in the class.
This class should contain data fields for the date, opening price, low price, high price, and closing price of a stock. All data fields shall have the PRIVATE access modifier..
Create getters and setters for each…
arrow_forward
Murach's javascript and Jquery 4th edition (ch9 animation)
I need help with this assignment, please. thanks
Modify a carousel to use animationIn this exercise, you’ll modify a carousel application so that when an image in the carousel is clicked, an enlarged image is displayed using animation.1. Open the application in this folder:carouselThen, run the application and notice that an enlarged image of the first book in the carousel is displayed.2. Review the HTML for the application, and notice that it contains an img element with an id of “image” following the heading. Also notice that the href attributes of the <a>elements in the carousel are set to the URL of the enlarged image to be displayed when the associated carousel image is clicked.3. Code an event handler for the click event of the <a> elements in the list. This event handler should start by getting the URL for the image to be displayed. Then, it should assign this URL to the enlarged image.4. Add animation to…
arrow_forward
That answer is wrong. Can you please read the instructions.
arrow_forward
Design a GUI using the following control: label, text field, button, checkbox, radio
button, combox box and list box.
Objectives:
Description
1. Create a project with your project name NetbeansGUI_YOURFAMILYNAME. Create a GUI as
shown below.
Input Account Number
Create Account
Button
Input Account Name
Textfields
Input Balance
Label
New Balance
Input Amount
Deposit
Buttons
Withdraw
Calc Interest
Textfield
Label (Error Message)
2. Add your DebitCard class in this project.
3. Click button Create Account creates the DebitCard object and displays in New Balance
the current balance. After creating the object, disable the button Create Account and
textfields in the create account panel. Display an error message if the input entered are
invalid.
4. Clicking buttons Deposit, Withdraw and Calc Interest will display in New Balance the
updated balance. Display error message if there is an error in any of the transaction.
arrow_forward
Visit the following webpage: https://archive.org/details/National_Geographic_Wallpapers This webpage hosts a collection of 506 images from National Geographic Magazine with most of these images previously being part of an international photography contest. Your task is to randomly choose 5 images and identify the objects within those images using Google’s vision API. Submit your iPython notebook code, and screenshots of output as shown below(no need to submit the images separately)
You may need to reactivate your Google vision API account (or billing information for trial cycles) if you haven’t used it recently.
arrow_forward
Can you help me with my project:The output of the project is to develop a simple application that includes searching, insert, and delete functionalities.
answer the questions and make a code of it
note: use #include <stdio.h> for the code
Can you please think a name in this application.(refer below)
1) For what is the application or What field does it belong to?
2) Who would use this app?
3) What can it do?
4) What are the benefits or advantages of this application?
Brief Description of the application to develop:
Refer in this for the code:
Our project is an application which monitors the number of passengers of each flight of a plane per day. This application may be used by the manager or operator/owner of the plane. It is capable of:
1) accepting the number of passengers per day of the different plane owned by the company;
2) displaying the number of passengers per plane per flight and per week;
3) searching for which plane and which day in a week given…
arrow_forward
without using enumerate.
arrow_forward
Please do not give solution in image format thanku
Software Engineering:
Project Description:
Sentiment Analysis System for Images, In this project, we will be creating an Sentiment Analysis system that utilizes machine learning to efficiently analyze people's feelings using their images. Then we will build a web application that is allowing users to upload an image and make a decision about whether it is positive, negative, or neutral.
I need the following (please in details and clearly):
A) Context models (The whole System)B) Use case modeling (At least four of your system features or activities)C) Class diagrams1. Classes and associations (The whole System)2. Class diagram (At least four of your system activities)D) Sequence diagram (At least four of your system activities)
Thank you!
arrow_forward
files for the work: https://mega.nz/file/AEJQFZIT#IKKIb5DD9h-5fHiWzEAIg8Lm60syggKnAwL1fqQQ168
Therefore, you should have print statements only where it is explicitly mentioned in the assignment. If you have additional print statements, make sure they are all converted to comments before you submit the assignment. Page 4 of 12 Assignment # 4 Due: Nov. 27th 11:00 PM 1. Text File Format Download the zipped file Files_for_A4 from Brightspace. When you will extract this zipped file you should find the following text files in the folder. The sample text files (datafile) are aTaleOfTwoCities.txt, harry.txt, harryPotter.txt, and invisibleMan.txt. You may assume that the words of the text files are separated by spaces (* ') and newline characters ( *\n'). You will be using these text files to do the analysis. There are two additional files (wordfile) named positivewords.txt and negativewords.txt; each of these files contains a sequence of words (one word per line) and these words will be…
arrow_forward
Name: Be Anne
Nickname: Reese
Phone: +63298612345
Fav Film: Doctor Strange
Hobby: Collecting Stamps
Ambition: Travel the world
Motto: " We may encounter many defeats but we must not be defeated"
Favorite Food: Adobo
Favorite singer: Taylor swift
Favorite Music: Enchanted by taylor swift
Favorite Perfume: Oh my george by Georgina Wilson
arrow_forward
Which of the following are true about code reuse. Select all that apply.
Group of answer choices
1. Code on the internet is tested by everyone who downloads it, so it is well tested and is almost always a good choice for code reuse.
2. While programming, as long as our code passes its test, we don’t need to make any other considerations for how it might be reused.
3. It is better to reuse code that is already being used instead of implementing new code from scratch, because the currently used code becomes robust with age.
3. Reuse of code decreases the amount of programming time.
arrow_forward
Assignment
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "Rooter" (without the quotation marks) that does the following:
1) Gets a positive integer (i.e. any number greater than 0) called "start" from the user after outputting a meaningful prompt.
2) Include data validation to ensure the user provides a positive integer. If the validation is not passed, provide the user with suitable feedback and stay in the program to let the user try again until valid input is received.
3) Uses a while loop that finds and displays the square root of every number from "start" down through 0.
As an example, if the user entered 8, you would find the square root of 8, then the square root of 7, and so on.
NOTES: Print each square root on a separate line. Use the Math.sqrt(double a) method to find each square root and output the result as a float using four decimal…
arrow_forward
As stated in the last module, this week you will exchange your draft with a partner so they can review it with the rubric. The goal of this exchange is to help mold and rework your draft for submission by Saturday. Because this is a quick turnaround, please make sure you complete the review of your peer’s paper by Thursday so that they will have time to make any changes prior to submission. Additionally, posting your draft prior to Tuesday is strongly encouraged as this will allow additional time for your peer to review your draft.
Remember, in total, your research paper needs to be written and formatted using the APA style guide and should include 5-6 pages of text. Your page requirement does not include the cover page, abstract, or reference page. Your research paper should also include a minimum of 3-4 reputable sources.
Apa research paper on prymids
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Related Questions
- A-List Objective: At the end of the exercise, the students should be able to: ▪ Create an adjacency list in Java. Software Requirements: ▪ NetBeans IDE Java Development Kit (JDK) 8 Procedure: 1. Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark) 2. Using NetBeans, create a Java project named AdjacencyList. Set the project location to your own folder. 3. Create an adjacency list based on the given graph. B A с E D F Garrow_forwardUpload the code that will display if the user won or lost the round of hangman. It should also prompt the user if they want to play another round of hangman. 1 Add file Send me a copy of my response. Submit This form was created inside of Leanderisd.org. Report Abusearrow_forwardREact JS Assignment: Create a Bulb component that can be switched On/Off on click of button (we covered this in class)Assignment: Create two bulbs (on click of btn turn anyone of it --red or green)Assignment: Add delete functionality to the Employee Tablearrow_forward
- Move the appropriate file types from the list on the left to the correct descriptions on the right. File Types (Icons) XE F E 4 Answer Area A file where you create the user interface allowing you to display information and react to user input. A file that contains all the setup information for your app. A file that contains coded app logic. A file that contains a list of available resources to be used in the project.arrow_forwardCreate a simple program for a quiz bee. Software Requirements: Latest version of NetBeans IDE Java Development Kit (JDK) 8 Procedure: 1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive. 2. Create a new project named LabExer5B. Set the project location to your own folder. 3. The program shall: contain an array of 10 multiple choice questions with three (3) choices each and require the user to choose among A, B, or C; Note: Cases are ignored. Lowercase letters are acceptable (a, b, c). 4. Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the following: • an invalid letter (not A, B, or C) • a number or any special character • blank (no answer) 5. Prompt the user that he can answer again if any of the three (3) exceptions is thrown. 6. Display the score.arrow_forwardCourse Title : Operating SystemQuestion : How you will create new user using terminal in Ubuntu? Add screenshots of all steps for new user creation including terminal and Login page in Answer sheet. Every student has to create new user as of his/her arid number for example (18-arid-2929). Note: screenshots are mandatory.arrow_forward
- The Problems - contains only problems from the last 2 contests Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The Featured drop-down menu has different difficulty ranges so you can try problems that best suit your experience. Popular topics and brands Like most users, Chef didn't know that he could add problems to his personal to-do list by clicking the magic "+" symbol in the upper right corner of each problem page. But once he found out about it, he went crazy and added a lot of problems to his to-do list without looking at their difficulty rating. Rajesh is a beginner and ideally should only try to solve problems strictly below 10001000. Given the difficulty rating list of problems in Chef's to-do list, please help him determine how many of these problems Chef should remove from his to-do list so he is left with only problems with a difficulty rating of less than 10001000. Note: Please answer the question in Python only: Input 1 4 999 1000 1001 1002…arrow_forwardadd tags for these feature files with --tags option: When you select scenarios by one tag When you select scenarios that have one or another tag When you select scenarios that have 2 tags When you disable scenarios that have a specific tag Given Scenarios: Feature: Login functionalityBackground:Given a web browser is at the BrainBucket login pageScenario: user can't login without entering emailGiven User is not logged inWhen Password is enteredAnd User click Login buttonThen 'Warning: No match for E-Mail Address and/or Password' will be shownScenario: user can recover his passwordGiven User is not logged inWhen User clicks 'Forgotten Password' buttonAnd enters his emailThen Message 'An email with a confirmation link has been sent your email address.' will be dispalyedarrow_forwardRISK REGISTER : CYBER SECURITY LAB (KEYLOGGING SOFTWARE). Please add 3 more risks. Intructions: please see below. 1) Have your team identify the top 5-10 risks for your project (i.e. one of the computers don't work, the electrical system is overloaded when all the computers are on, a component of one of the computers is misplaced or stolen, etc.).arrow_forward
- Written Assignment #1: To submit your assignment, click on the Written Assignment #1 link above. This will take you to a Preview Upload Assignment window. You'll need to scroll down to Assignment Submission. From here you can write a text submission or select Browse My Computer and find your file. Directions: Answer each of the following questions. Show your work or explain how you arrived at your conclusion whenever appropriate. Use your calculator. In a random sample of 175 community college students, the mean number of hours spent studying per week is 13.7 hours and the standard deviation is 4 hours. a) Find the standard score (z-score) for students who study the following hours in a particular week. Round Z to the nearest hundredth and interpret the meaning of each answer as it pertains to this problem. i) 22 hours ii) 6 hours b)Assuming the distribution of the number of hours community college students study per week is normally distributed, approximately how many of the students…arrow_forwardGeneral Description For this assignment, you will read and process historical stock data for the Tesla company. Project Setup and Structure Create a new java project in Eclipse and call it homework01. Inside the src folder, create a new java package called hw01. All your source code files will need to be placed in the hw01 file. Inside the src folder, create a new folder called files. Your .csv files should go in files. NOTE: When working with the .csv file, your program must use a relative path to the .csv file, NOT an absolute path. TeslaStock Class Create a class called TeslaStock. This class will be used to represent each stock's data in your project. This class should not contain any methods to read/write the data. Only implement the following in the class. This class should contain data fields for the date, opening price, low price, high price, and closing price of a stock. All data fields shall have the PRIVATE access modifier.. Create getters and setters for each…arrow_forwardMurach's javascript and Jquery 4th edition (ch9 animation) I need help with this assignment, please. thanks Modify a carousel to use animationIn this exercise, you’ll modify a carousel application so that when an image in the carousel is clicked, an enlarged image is displayed using animation.1. Open the application in this folder:carouselThen, run the application and notice that an enlarged image of the first book in the carousel is displayed.2. Review the HTML for the application, and notice that it contains an img element with an id of “image” following the heading. Also notice that the href attributes of the <a>elements in the carousel are set to the URL of the enlarged image to be displayed when the associated carousel image is clicked.3. Code an event handler for the click event of the <a> elements in the list. This event handler should start by getting the URL for the image to be displayed. Then, it should assign this URL to the enlarged image.4. Add animation to…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,