Lab Topic 3 individual 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
1
Uploaded by ProfLightning103643 on coursehero.com
Lab: Topic 3 (individual)
ENGR 102 – Fall 2023
Lab: Topic 3 (individual)
Deliverables.
Please complete the activity as described below. The activity is an individual assignment, but you may
consult your teammates and others as you work. Please submit the following file to zyBooks.
writing_functions.py
Activity #1
:
Writing functions – individual
This activity provides practice for writing programs to perform multiple complex calculations, and to give
you practice with writing and calling basic functions.
Write a program that calculates the area of several regular polygons when given a side length. Your
program should take as input from the user a value for side length and calculate the following values:
The area of an equilateral triangle
The area of a square
The area of a regular pentagon
The area of a regular dodecagon (12 sides)
We’re going to ignore units for this problem. Define a function
for each shape
that calculates the area
and generates the output according to the example shown below. Use two (2) decimal places for the side
length and three (3) for the area. Write a single program that outputs all calculations named
writing_functions.py
.
Before you beginning coding, you should stop and think briefly about how you want to structure your
program. This activity is a great way to practice writing and calling functions.
Example output (using input
1.25
):
Please enter the side length:
1.25
A triangle with side 1.25 has area 0.677
A square with side 1.25 has area 1.562
A pentagon with side 1.25 has area 2.688
A dodecagon with side 1.25 has area 17.494
Helpful Hint
: When testing/debugging a program that requires input from the keyboard, it can be quite
frustrating to have to retype the input every time you want to run the program. One technique for
dealing with this problem is to simply “hard code” the variable values during the debugging process
(assign variable values in the code rather that retrieving values from the keyboard), then add the code to
retrieve the input from the keyboard after you are sure the code works.
Based upon Dr. Keyser’s Original
1
Revised Fall 2023 SNR
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Teams ( Teamcode , Teamname, Clubname, total_member, dateofstart, teammanager,teamcoach)
Players (Teamcode, playername, dateofbirth, specialposition, Numberofgoal, number of tournaments, Tshirtno)
Tournament (Tcode, Tname, Year, Hostcountry, numberofteams, winnerteam, goldenboot)
Tournament_teams (Tcode, teamcode, totalyellocard, totalredcard, numberofgoals)
Matchdetail (Mtcode, Team1code,team2code, winnerteamecode, matchdate ,team1goal,team2goal,refree)
List the detail of player of who has done max. goal in his team.
arrow_forward
Teams ( Teamcode , Teamname, Clubname, total_member, dateofstart, teammanager,teamcoach)
Players (Teamcode, playername, dateofbirth, specialposition, Numberofgoal, number of tournaments, Tshirtno)
Tournament (Tcode, Tname, Year, Hostcountry, numberofteams, winnerteam, goldenboot)
Tournament_teams (Tcode, teamcode, totalyellocard, totalredcard, numberofgoals)
Matchdetail (Mtcode, Team1code,team2code, winnerteamecode, matchdate ,team1goal,team2goal,refree)
Show me the teams whose player have done max. goals
List the detail of player of who has done max. goal in his team.
List the team detail of the winner of each tournament
arrow_forward
Task Class Requirements
The task object shall have a required unique task ID String that cannot be longer than 10 characters. The task ID shall not be null and shall not be updatable.
The task object shall have a required name String field that cannot be longer than 20 characters. The name field shall not be null.
The task object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null.
Verify with Juint testing as well
arrow_forward
ExecutorService method "execute":
obtains an ExecutorService that creates new threds as they are needed
notifies the ExecutorService to stop accepting new tasks, but continues executing taskst that have alredy been submitted
All of the above
None of the above
arrow_forward
Task 1: Planning and Passengers
For this task we will be creating an overview of the classes in our system using
the Unified Modeling Language (UML) Class Diagram.
IMPORTANT: When submitting this question, you must submit it as a Portable
Network Graphics (PNG) file.
Below is a list of tools for drawing UML diagrams, but you are free to use any
program of your choosing:
. Google Drawings (https://docs.google.com/drawings/)
. Plant UML (https://plantuml.com/)
• Inkscape (https://inkscape.org/)
• Visual Paradigm (https://online.visual-paradigm.com/)
You may use any tool you wish as long as your diagram follows the UML
conventions and is in the correct format (PNG).
Instructions IMPORTANT: Unless otherwise stated, all attributes should be
private or protected. You may decide for yourself whether an attribute should
be private or protected.
Draw the UML class diagrams for the following classes:
1. An abstract Java class called Person that has the following attributes:
a String called…
arrow_forward
Student Companion ™ is your personal academic guide that provides the following basic information for each course while a student at the USC. Courses done, grades earned, Course outline attachments, course notes etc.This is a simple application to keep track of each course you are doing/have done and can serve as a personal test timetable for the course which has final quiz, keep track of your courses that have etc. The concept is like a personal check sheet system blended with a simple quiz timetable.
This also solves a problem that often shows up when students have completed their program and need to revert back to data pertaining to their academic life from their viewpoint. Please note this does not replace a transcript, which is an official University Document.
1. Create a Class Diagram of at least six (6) major entities for your application. For entities with a large number of attributes you are allowed to limit your attributes to a max of six (6). All operations within each class…
arrow_forward
create code, no if or return on it.
arrow_forward
Scheduling Goals: Select all of the following statements that are true.
The response time is the time required for a particular process to complete, from
submission time to completion.
The time that elapses in an interactive program from the issuance of a command
to the beginning of a response to that command is called the response time.
Throughput is the number of processes completed per time unit.
The waiting time is included in the turnaround time.
The concept of virtual (run)time in the Completely Fair Scheduler is used to
ensure fairness in the allocation of processor capacity.
In interactive systems, short response times are unimportant.
arrow_forward
Apply for higher studies: The system allows the students to search for study programs and apply
for higher studies in foreign universities (applying requires attaching transcripts). Administrator
can use this application to download reports add more seats into the course. etc etc
Create your own case study (problem statement) for the above application by expanding it with more
details from your side and for this case study
1. Class diagram with at least 4 classes and explain all the relationships
3. Draw the use case diagram
arrow_forward
Lab conditions:
This lab exercise to be completed by the end of the class. No late submission will be accepted
Work as group of two students.
Submit Word document file on D2L
Make sure your following naming format as listed below:
Last name, First Name:
Last name, First Name:
Questions:
1. Research, discuss Explain the purpose of different personal computer (PC) hardware components.
Make sure to address all the aspect of the topic.
Partial list of opcodes:
2. Desktop Computer DIY. Suppose you decide to build a desktop by yourself and your budget is
around $1000 (without OS). Discuss with your team members and list all the parts and tools you have
to purchase with price. List the technical Details and explain what your desktop will be used for, such
as listen to music, word document, 3D design, software development, watch movie and so on.
3. Download and run CPU-Z. Paste your screenshots (technical details) below.
4. Challenge Question
Consider the hypothetical machine:
Instruction…
arrow_forward
Programming Problem 1 – Calculating a
Number
As part of the discussion forum for this unit, you will be
solving a programming problem from the book. This
assignment will have you calculating the chapter and the
number of the programming problem that you will solve for
the online discussion forum.
To calculate the chapter from which you solve the
programming exercise:
• Divide the integer number representing your student ID by
3, consider the remainder and increment it by 3. The
result you obtain represents the chapter number, and it
should be either 2, 3, 4, or 5.
Depending on the chapter number obtained above, consider the
following rules in calculating the problem number to solve:
• If the chapter number is 3, divide your student ID by 34,
consider the remainder and increment it by 1. The result
you obtain represents the number of the programming
exercise you will solve for online discussions, which
should be from chapter 3.
• If the chapter number is 4 (you need to go to chapter 6),…
arrow_forward
excel
Task Instructions
In the Column chart, switch the data shown In the rows
and columns.
arrow_forward
Q: It is always challenging to decide when to stop testing. Testing exit criteria can be decided either formally or informally.You are required to write a minimum of 2500 words on testing exit criteria.Note: Attach plagiarism report with it and the percentage of plagiarism must be less than 15%.
arrow_forward
Q4/ Design a standard project with four forms when running project all
forms appear on screen Note :use this code in form1 (form1.show,
form2.show, form3.show, form4.show)
arrow_forward
Overview: Create a coin flip game that allows the user to guess whether the coin will be heads or tails. Save the data associated with the flip. Repeat for a total of 10 guesses/flips. Display result summary and details at end.
Technical Requirements:
Participant will guess whether a coin flip will result in Heads or Tails
Computer will "flip" a coin to determine the side it lands using random generator
import random at top of program
result = random.randint(x,x)
The program will display the results: Guess, Flip, Outcome (Match or No Match)
The program will track the results and, when the game is over, display:
Summary
Detailed result of each turn
Use parallel arrays to collect details from each turn that can be displayed as a table when the game is over
Use running totals of each result detail to display at end
arrow_forward
me
words
Insert
Chapter 8 example.docx-Word
View
Review
Design
Tell me what you want to do...
Layout
Mailings
References
Class A:
Int data1, data2
A(int d1,int d2)// initialize data1, data2
Int Add() // adds two numbers: data1, data2
0
Class B:
Data3
Int AddFromB(int d1,int d2, int d3)// adds three numbers {
Super(d1, d2)
Int s=Add()
Int sb=s+d3}
Suppose you have a class called A which have two integer
data(data1, data2) and a method Add() which returns
sammation of data1and data2.
Another class B has an integer data3 and a method AddFromB()
which adds data3 with the returned result of Add().
Now implement the above scenario and show the summation of
three integer numbers.
Ix
Sign in
arrow_forward
mming assignment. To upload and submit the program and materials you created,
select your saved documents. Make sure that the files are saved with your last name in the file name (Example: ch4_ca
COSTUME SHOP
68.
Create a requirements document and a Use Case Definition document and then design a Windows Form mock-up based c
1 C
#
3
E
D
costume rental specials are as follows:
A costume shop requests a computer application that advertises costume rentals. This week's
$
4
R
Destination
Renaissance Fair
Write an application that allows the user to select any of the five costume rental specials.
When the user selects a costume, the corresponding cost and a picture of the costume should
be displayed. Clear each prior price and picture when the user selects a different costume. After
selecting a costume, the user should be able to book the costume rental and then exit the window.
F
Stormtrooper
Batman/Batgirl
Pirate
Q Search Bing
do L
%
5
T
G
6
MacBook Pro
Y
FIGURE 2-68
Price
$40 week rental…
arrow_forward
Employee view attendance report
The employee must be logged in to the
system to perform this function. The
employee selects the report period (range
of dates: from - to). The employee selects
"show report". Range of dates for the
report must be maximum 3 months, so if
the range is invalid, the system displays an
error message. The system displays every
working day in the report with the status
of the employee in this day, which could
be one of the following: on time, late, did
not come.
One actor?
One use case name?
One class ?
Attributes for the class ?
One relation between classes ?
arrow_forward
This is a screen shot of the assignment. Thank you
arrow_forward
@#Correct and detailed answer will be Upvoted else downvoted.
arrow_forward
Data encapsulation: what is it, and when would you want to utilize it?
arrow_forward
Composition is also know as
relationship.
Select one:
a.part-of
b.has-a
c.with-a
d.is-a
arrow_forward
MSIT 501/BMME 8050 Project #1 Description: You are working for a carpeting and flooring company. You need a program to create an estimate for customers. There are three types of rooms that customers might have: square, rectangle and circle. Yes, some people have houses with rooms that are circles. The program should ask for the customer’s name and address. Then ask for the dimensions of the room, in feet. It should then determine the cost to put flooring in the room. We compute flooring based upon the area of the room in square feet. Flooring material costs $2.00 per square feet and installation costs $1.50 per square foot. The equations for calculating the square footage of rooms are as follows: • Square: area = side1 ^ 2 • Rectangle: area = side1 * side2 • Circle: area = radius ^ 2 * pi Once the user has entered the information, the program should print out the customer information. Then it should print the total square feet in the room followed by the estimate for the materials and…
arrow_forward
Task Class Requirements
The task object shall have a required unique task ID String that cannot be longer than 10 characters. The task ID shall not be null and shall not be updatable.
The task object shall have a required name String field that cannot be longer than 20 characters. The name field shall not be null.
The task object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null.
Task Class with JUnit test case with it!
Please do not copy and paste from others with TaskService. It's not helpful and does not relate to what I am doing. Thank you.
Java language
arrow_forward
LabVIEW Activity: GPA Calculator
Create a VI that allows you to enter Course grade (on the 4 point scale) and the number of credits and calculate your semester GPA. Enter your grade by a drop down letter grade and have the block diagram convert it to a numeric value.
arrow_forward
Marriage
Validity
You were hired by the City Hall of Kulafu as a programmer. Your task is to write
a spreadsheet program that will determine whether two individuals can be married legally or not.
The marriage will be legal depending on the following conditions:
both individuals should be at least 18 years old
the individuals should not have the same gender (same gender marriage is not legal
in Kulafu)
the individuals should not have a married status (in Kulafu, status are single,
widow/widower, divorced and married)
Write a program that will accept via keyboard the information regarding the age,
gender and marital status of the two individuals. The following numeric coding system should
be used: for gender: M or m represents Male and F or f represents Female. For marital status:
S or s represents Single, W or w represents Widow/Widower, D or d represents Divorced and
MA or ma represents Married. The word should output the word "LEGAL" if all the criteria
above are met. Otherwise, the…
arrow_forward
At the end of the exercise, the students should be able to:
Create a simple game that handles
Software Requirements:
Latest version of NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
Create a folder named LastName_FirstName(please write Dahanyoon (ex. Reyes_Mark) in your local
Create a new project named LabExer5A. Set the project location to your own
The program shall:
generate a random number from 1 to 50 for a player to guess;
display a message that indicates whether the player’s guess is correct, too low, or too high; and
prompt the user to keep on guessing until the correct value is entered
Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following:
a number that is out of range (1 – 50)
a letter or any non-numeric character
Prompt the user so that he can guess again if an exception is
Display the number of total
Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt.
arrow_forward
Create the following variables that can be used to store values. Use the naming conventions as outlined in the Algorithms/Pseudocode Guidelines document in the course resources section of the course.
1. test grade for student test
2. total of all test grades added together
3. the average for the test grades
Create an assignment statement that sets the value of the variable you created to store the value of all test grades added together to zero. You may refer to Table 6.1 in Chapter 6 for examples.
Create an input statement to input the value for the first test grade for the variable you created.
Create an algorithm that will obtain the test grade for three students, add the test grades together, calculate the average of the test grades, and output the average. Use a count-controlled loop to create the algorithm. Use the information from your answers to questions 3, 4, and 5 in the creation of your algorithm. Also use information and examples from Chapter 6…
arrow_forward
follow instructions.
create functions
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
First you should ask for the number of tasks to perform.
Then you should create a list of tasks with that many entries.
Ask the user if they have completed each task.
Report the tasks that have yet to be completed.
arrow_forward
Correct answer will be appreciated.else downvoted.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Related Questions
- Teams ( Teamcode , Teamname, Clubname, total_member, dateofstart, teammanager,teamcoach) Players (Teamcode, playername, dateofbirth, specialposition, Numberofgoal, number of tournaments, Tshirtno) Tournament (Tcode, Tname, Year, Hostcountry, numberofteams, winnerteam, goldenboot) Tournament_teams (Tcode, teamcode, totalyellocard, totalredcard, numberofgoals) Matchdetail (Mtcode, Team1code,team2code, winnerteamecode, matchdate ,team1goal,team2goal,refree) List the detail of player of who has done max. goal in his team.arrow_forwardTeams ( Teamcode , Teamname, Clubname, total_member, dateofstart, teammanager,teamcoach) Players (Teamcode, playername, dateofbirth, specialposition, Numberofgoal, number of tournaments, Tshirtno) Tournament (Tcode, Tname, Year, Hostcountry, numberofteams, winnerteam, goldenboot) Tournament_teams (Tcode, teamcode, totalyellocard, totalredcard, numberofgoals) Matchdetail (Mtcode, Team1code,team2code, winnerteamecode, matchdate ,team1goal,team2goal,refree) Show me the teams whose player have done max. goals List the detail of player of who has done max. goal in his team. List the team detail of the winner of each tournamentarrow_forwardTask Class Requirements The task object shall have a required unique task ID String that cannot be longer than 10 characters. The task ID shall not be null and shall not be updatable. The task object shall have a required name String field that cannot be longer than 20 characters. The name field shall not be null. The task object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null. Verify with Juint testing as wellarrow_forward
- ExecutorService method "execute": obtains an ExecutorService that creates new threds as they are needed notifies the ExecutorService to stop accepting new tasks, but continues executing taskst that have alredy been submitted All of the above None of the abovearrow_forwardTask 1: Planning and Passengers For this task we will be creating an overview of the classes in our system using the Unified Modeling Language (UML) Class Diagram. IMPORTANT: When submitting this question, you must submit it as a Portable Network Graphics (PNG) file. Below is a list of tools for drawing UML diagrams, but you are free to use any program of your choosing: . Google Drawings (https://docs.google.com/drawings/) . Plant UML (https://plantuml.com/) • Inkscape (https://inkscape.org/) • Visual Paradigm (https://online.visual-paradigm.com/) You may use any tool you wish as long as your diagram follows the UML conventions and is in the correct format (PNG). Instructions IMPORTANT: Unless otherwise stated, all attributes should be private or protected. You may decide for yourself whether an attribute should be private or protected. Draw the UML class diagrams for the following classes: 1. An abstract Java class called Person that has the following attributes: a String called…arrow_forwardStudent Companion ™ is your personal academic guide that provides the following basic information for each course while a student at the USC. Courses done, grades earned, Course outline attachments, course notes etc.This is a simple application to keep track of each course you are doing/have done and can serve as a personal test timetable for the course which has final quiz, keep track of your courses that have etc. The concept is like a personal check sheet system blended with a simple quiz timetable. This also solves a problem that often shows up when students have completed their program and need to revert back to data pertaining to their academic life from their viewpoint. Please note this does not replace a transcript, which is an official University Document. 1. Create a Class Diagram of at least six (6) major entities for your application. For entities with a large number of attributes you are allowed to limit your attributes to a max of six (6). All operations within each class…arrow_forward
- create code, no if or return on it.arrow_forwardScheduling Goals: Select all of the following statements that are true. The response time is the time required for a particular process to complete, from submission time to completion. The time that elapses in an interactive program from the issuance of a command to the beginning of a response to that command is called the response time. Throughput is the number of processes completed per time unit. The waiting time is included in the turnaround time. The concept of virtual (run)time in the Completely Fair Scheduler is used to ensure fairness in the allocation of processor capacity. In interactive systems, short response times are unimportant.arrow_forwardApply for higher studies: The system allows the students to search for study programs and apply for higher studies in foreign universities (applying requires attaching transcripts). Administrator can use this application to download reports add more seats into the course. etc etc Create your own case study (problem statement) for the above application by expanding it with more details from your side and for this case study 1. Class diagram with at least 4 classes and explain all the relationships 3. Draw the use case diagramarrow_forward
- Lab conditions: This lab exercise to be completed by the end of the class. No late submission will be accepted Work as group of two students. Submit Word document file on D2L Make sure your following naming format as listed below: Last name, First Name: Last name, First Name: Questions: 1. Research, discuss Explain the purpose of different personal computer (PC) hardware components. Make sure to address all the aspect of the topic. Partial list of opcodes: 2. Desktop Computer DIY. Suppose you decide to build a desktop by yourself and your budget is around $1000 (without OS). Discuss with your team members and list all the parts and tools you have to purchase with price. List the technical Details and explain what your desktop will be used for, such as listen to music, word document, 3D design, software development, watch movie and so on. 3. Download and run CPU-Z. Paste your screenshots (technical details) below. 4. Challenge Question Consider the hypothetical machine: Instruction…arrow_forwardProgramming Problem 1 – Calculating a Number As part of the discussion forum for this unit, you will be solving a programming problem from the book. This assignment will have you calculating the chapter and the number of the programming problem that you will solve for the online discussion forum. To calculate the chapter from which you solve the programming exercise: • Divide the integer number representing your student ID by 3, consider the remainder and increment it by 3. The result you obtain represents the chapter number, and it should be either 2, 3, 4, or 5. Depending on the chapter number obtained above, consider the following rules in calculating the problem number to solve: • If the chapter number is 3, divide your student ID by 34, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 3. • If the chapter number is 4 (you need to go to chapter 6),…arrow_forwardexcel Task Instructions In the Column chart, switch the data shown In the rows and columns.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr