Answer:
Explanation:
.data
msg1: .asciiz "Enter the floating point value = "
msg2: .asciiz "\nEnter the shape (Circle - 1, Triangle - 2, Square - 3) = "
msg3: .asciiz "\nThe perimeter of the triangle with side = "
msg4: .asciiz " meters is "
msg5: .asciiz " meters.\n"
msg6: .asciiz "\nThe area of the triangle with side = "
msg7: .asciiz " square meters.\n"
msg8: .asciiz "\nThe circumference of the circle with radius = "
msg9: .asciiz "\nThe area of the circle with radius = "
msg10: .asciiz "\nThe perimeter of the square with side = "
msg11: .asciiz "\nThe area of the square with side = "
pi: .float 3.1415816
eq_tr_area: .float 0.43305186
two: .float 2
three: .float 3
four: .float 4
.text
li $v0,4 # system call code for printing string = 4
la $a0,msg1 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0,6 # system call code for reading floating point number
syscall # call operating system to perform read operation
li $v0,4 # system call code for printing string = 4
la $a0,msg2 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0,5 # system call code for reading integer
syscall # call operating system to perform read operation
move $t0,$v0
IF:
bne $t0,1,ELSE_IF #if not 1 then goto elseif
li $v0,4 # system call code for printing string = 4
la $a0,msg8 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
l.s $f1,pi
l.s $f3,two
mul.s $f3,$f3,$f1 #calculate 2*pi*radius
mul.s $f3,$f3,$f0
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f3 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg5 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg9 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
mul.s $f2,$f0,$f0 #calculate radius *radius
mul.s $f2,$f2,$f1 #calculate pi *r^2
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f2 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg7 # load address of string to be printed into $a0
syscall
ELSE_IF:
bne $t0,2,ELSE #if not 2 then check else
li $v0,4 # system call code for printing string = 4
la $a0,msg3 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
l.s $f3,three
mul.s $f3,$f3,$f0 #calculate 3*side
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f3 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4
la $a0,msg5
syscall
li $v0,4
la $a0,msg6
syscall
li $v0, 2
mov.s $f12,$f0
syscall
li $v0,4
la $a0,msg4
syscall
l.s $f3,eq_tr_area
mul.s $f2,$f0,$f0
mul.s $f2,$f2,$f3
li $v0, 2
mov.s $f12,$f2
syscall
li $v0,4
la $a0,msg7
syscall
ELSE:
bne $t0,3,END
li $v0,4
la $a0,msg10
syscall
li $v0, 2
mov.s $f12,$f0
syscall
li $v0,4
la $a0,msg4
syscall
l.s $f3,four
mul.s $f3,$f3,$f0
li $v0, 2
mov.s $f12,$f3
syscall
li $v0,4
la $a0,msg5
syscall
li $v0,4
la $a0,msg11
syscall
li $v0, 2
mov.s $f12,$f0
syscall
li $v0,4
la $a0,msg4
syscall
mul.s $f2,$f0,$f0
li $v0, 2
mov.s $f12,$f2
syscall
li $v0,4
la $a0,msg7
syscall
END:
li $v0,10
syscall
Code is as follows:
.data
msg1: .asciiz "Enter the floating point value = "
msg2: .asciiz "\nEnter the shape (Circle - 1, Triangle - 2, Square - 3) = "
msg3: .asciiz "\nThe perimeter of the triangle with side = "
msg4: .asciiz " meters is "
msg5: .asciiz " meters.\n"
msg6: .asciiz "\nThe area of the triangle with side = "
msg7: .asciiz " square meters.\n"
msg8: .asciiz "\nThe circumference of the circle with radius = "
msg9: .asciiz "\nThe area of the circle with radius = "
msg10: .asciiz "\nThe perimeter of the square with side = "
msg11: .asciiz "\nThe area of the square with side = "
pi: .float 3.1415816
eq_tr_area: .float 0.43305186
two: .float 2
three: .float 3
four: .float 4
.text
li $v0,4 # system call code for printing string = 4
la $a0,msg1 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0,6 # system call code for reading floating point number syscall # call operating system to perform read operation
li $v0,4 # system call code for printing string = 4 la $a0,msg2 # load address of string to be printed into $a0 syscall # call operating system to perform print operation
li $v0,5 # system call code for reading integer syscall # call operating system to perform read operation move $t0,$v0
IF:
bne $t0,1,ELSE_IF #if not 1 then goto elseif
li $v0,4 # system call code for printing string = 4
la $a0,msg8 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2 mov.s $f12,$f0 #move the single precision f2 in f12 syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4 la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
l.s $f1,pi l.s $f3,two
mul.s $f3,$f3,$f1 #calculate 2*pi*radius
mul.s $f3,$f3,$f0
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f3 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg5 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg9 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
mul.s $f2,$f0,$f0 #calculate radius *radius
mul.s $f2,$f2,$f1 #calculate pi *r^2
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f2 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg7 # load address of string to be printed into $a0
syscall
ELSE_IF:
bne $t0,2,ELSE #if not 2 then check else
li $v0,4 # system call code for printing string = 4 la $a0,msg3 # load address of string to be printed into $a0 syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f2 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
l.s $f3,three
mul.s $f3,$f3,$f0 #calculate 3*side
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f3 #move the single precision f2 in f12
syscall
bne $t0,3,END #if not 3 then end
li $v0,4 # system call code for printing string = 4
la $a0,msg10 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f0 #move the single precision f0 in f12
syscall # call operating system to perform print operation
li $v0,4 # system call code for printing string = 4
la $a0,msg4 # load address of string to be printed into $a0
syscall # call operating system to perform print operation
l.s $f3,four # multilply by 4
mul.s $f3,$f3,$f0 #calculate 4*side
li $v0, 2 # system call code for printing float = 2
mov.s $f12,$f3 #move the single precision f3 in f12
syscall # call operating system to perform print operation
END:
li $v0,10 # system call code for printing exit (end of program)
syscall # call operating system to perform print operation
Learn More:https://brainly.com/question/10169933
What is wrong with the following code?
int name = "Steve":
if (name = "Steve") {
System.out.prſntln("Hi Steve!);
}
Question 1a
1. Create a (3,3) array where row 0 is [0, 0, 0], row 1 is [2, 2, 2], row 2 is [-2, -2, -2]. Print the array.
2. Change element [0,0] to 10 and element [2,2] to -10. Print the array.
3. Subtract 2 from every element. Print the array.
4. Print all of the elements of the revised array that are positive.
In [ ]: # Your codes for 1.
In [ ]: # Your codes for 2.
In [ ]: # Your codes for 3.
In [ ]: # Your codes for 4.
Question 1b
You are provided with two lists of numbers.
• List 'x' denotes all 8 possible dollar investment outcomes of a risky project;
• List 'p' denotes their corresponding outcome probabilities.
• For instance, there is a 5% chance of $10000.
In this question, let's first convert the two lists into two separate arrays. Can you use np.dot to calculate the expected value of this risky project? That is, 10000X0.05+1000X0.05+100X0.2 ... Calculation without using np.dot() will be considered no points.
Finally, print the following sentence using print+format: The expected value of this risky project is $XXX.X.
Hint: the portfolio mean return example at the end of 2.3
In [ ]: x = (10000, 1000, 100, 10, 1, 0, -10, -100]
p = [0.05, 0.05, 0.20, 0.20, 0.1, 0.1, 0.1, 0.2]
In [ ]: # Your code here
Answer:
(1) The program in Python is as follows:
rows, cols = (3, 3)
arr =[[0,0,0],[2,2,2],[-2,-2,-2]]
print(arr)
arr[0][0] = 10
arr[2][2] = -10
print(arr)
for i in range(rows):
for j in range(cols):
arr[i][j]-=2
print(arr)
for i in range(rows):
for j in range(cols):
if arr[i][j]< 0:
print(arr[i][j], end = ", ")
(2) The program in Python is as follows:
import numpy as np
x = [10000, 1000, 100, 10, 1, 0, -10, -100]
p = [0.05, 0.05, 0.20, 0.20, 0.1, 0.1, 0.1, 0.2]
q = np.dot(x,p)
print(q)
Explanation:
(1)
This initializes the rows and columns of the array to 3
rows, cols = (3, 3)
1. This creates and array and also populates it with the given data
arr =[[0,0,0],[2,2,2],[-2,-2,-2]]
Print the array
print(arr)
2. This changes index 0,0 to 10 and index 2,2 to -10
arr[0][0] = 10
arr[2][2] = -10
Print the array
print(arr)
This iterates through the rows and the columns of the array
for i in range(rows):
for j in range(cols):
3. This subtracts 2 from each array element
arr[i][j]-=2
Print the array
print(arr)
This iterates through the rows and the columns of the array
for i in range(rows):
for j in range(cols):
If array element is negative
if arr[i][j]< 0:
4. Print the array element
print(arr[i][j], end = ", ")
(2)
Line 1 and 2 are given as part of the program
x = [10000, 1000, 100, 10, 1, 0, -10, -100]
p = [0.05, 0.05, 0.20, 0.20, 0.1, 0.1, 0.1, 0.2]
This uses np dot to multiply x and p
q = np.dot(x,p)
This prints the result of the product
print(q)
Importance of type casting in programming
Answer:
Typecasting, or type conversion, is a method of changing an entity from one data type to another. It is used in computer programming to ensure variables are correctly processed by a function. An example of typecasting is converting an integer to a string.
mark me brainliesttb :))
What is the output of the following code segment?
String[] cs = "Bill Gates and Paul Allen founded Microsoft on April 4, 1975.".split(" ");
System.out.println(cs[6].charAt(5));
Answer:
o
Explanation:
An airline describes airfare as follows. A normal ticket's base cost is $300. Persons aged 60 or over have a base cost of $290. Children 2 or under have $0 base cost. A carry-on bag costs $10. A first checked bag is free, second is $25, and each additional is $50. Given inputs of age, carry-on (0 or 1), and checked bags (0 or greater), compute the total airfare. Hints: First use an if-else statements to assign airFare with the base cost Use another if statement to update airFare for a carryOn Finally, use another if-else statement to update airFare for checked bags Think carefully about what expression correctly calculates checked bag cost when bags are 3 or more
Answer:
The program in Python is as follows:
age = int(input("Age: "))
carryOn = int(input("Carry on Bags [0 or 1]: "))
checkedBags = int(input("Checked Bags [0 or greater]: "))
airFare = 300
if age >= 60:
airFare = 290
elif age <= 2:
airFare = 0
if carryOn == 1:
airFare += 10
if checkedBags == 2:
airFare += 25
elif checkedBags > 2:
airFare += 25 + 50 * (checkedBags - 2)
print("Airfare: ",airFare)
Explanation:
This gets input for age
age = int(input("Age: "))
This gets input for carry on bags
carryOn = int(input("Carry on Bags [0 or 1]: "))
This gets input for checked bags
checkedBags = int(input("Checked Bags [0 or greater]: "))
This initializes the base cost to 300
airFare = 300
This updates the base cost to 290 for adults 60 years or older
if age >= 60:
airFare = 290
This updates the base cost to 0 for children 2 years or younger
elif age <= 2:
airFare = 0
This updates the airFare if carryOn bag is 1
if carryOn == 1:
airFare += 10
if carryOn bag is 0, the airFare remains unchanged
This updates the airFare if checkedBags is 2. The first bag is free; so, only the second is charged
if checkedBags == 2:
airFare += 25
This updates the airFare if checkedBags greater than 2. The first bag is free; so, only the second and other bags is charged
elif checkedBags > 2:
airFare += 25 + 50 * (checkedBags - 2)
if checkedBags is 0 or 1, the airFare remains unchanged
This prints the calculated airFare
print("Airfare: ",airFare)
Ideally, how often should you back up the data on your computer?
Answer:
not oftenly, but leave space for other things and important stuff.
Suppose class Person is the parent of class Employee. Complete the following code:
class Person :
def __init__(self, first, last) :
self.firstname = first
self.lastname = last
def Name(self) :
return self.firstname + " " + self.lastname
class Employee(Person) :
def __init__(self, first, last, staffnum) :
Person.__init__(self,first, last) self.staffnumber = staffnum
def GetEmployee(self) :
return self.Name() + ", " + self.staffnumber
x = Person("Sammy", "Student")
y = Employee("Penny", "Peters", "805")
print(x.Name())
print(y.GetEmployee())
Answer:
Explanation:
There is nothing wrong with the code it is complete. The Employee class is correctly extending to the Person class. Therefore, the Employee class is a subclass of Person and Person is the parent class of Employee. The only thing wrong with this code is the faulty structure such as the missing whitespace and indexing which is crucial in Python. This would be the correct format. You can see the output in the picture attached below.
class Person :
def __init__(self, first, last) :
self.firstname = first
self.lastname = last
def Name(self) :
return self.firstname + " " + self.lastname
class Employee(Person) :
def __init__(self, first, last, staffnum) :
Person.__init__(self,first, last)
self.staffnumber = staffnum
def GetEmployee(self) :
return self.Name() + ", " + self.staffnumber
x = Person("Sammy", "Student")
y = Employee("Penny", "Peters", "805")
print(x.Name())
print(y.GetEmployee())
which type of computer is used to process large amount of data
Answer:
Mainframe Computer
Explanation:
Supercomputers
if you are looking for a different answer, please let me know and i will take a look! i'd love to help you out with any other questions you may have
Why a commerce student must learn about SDLC (Software Development Life Cycle) and its phases?
How SDLC could help a commerce graduate in career growth and success?
Answer:
The description of the given question is described throughout the explanation segment below.
Explanation:
A method that delivers the best reliability as well as cheapest possible applications throughout the specified timeframe, is termed SDLC. A business student could perhaps read about such a life cycle and its stages when individuals not only relate to scientific issues and mean effective pressure.
Whenever a successful entrepreneur does an inventory of an enterprise, people are useful. SDLC demonstrates the capacity for decision-making or judgments.c program to check if number is even
Answer:
Yes.
Explanation:
Check the jpeg below for the code.
In addition to explaining the paper’s topic, a thesis statement provides instructions on how to read the paper. explains why the paper was written. determines who will read the paper. serves as the paper’s road map for the reader.
Answer: I believe it’s explains why the paper was written!
Explanation:
Took edge 2021
Answer:
Explains why the paper was written.
Explanation:
Please give brainliest.
In a network, servers receive requests from which of the following?
clients, which are the networked computers that request data.
O other networked computers, which use encrypted messages.
O ISPs, which control the type of data that can be sent on the network.
O routers, which direct the data to the correct destination.
Answer: routers, which direct the data to the correct destination.
Explanation:
In a network, servers receive requests from the routers, which direct the data to the correct destination.
The router simply refers to the networking device which helps in the forwarding of data packets between the computer networks. When a data packet is sent through one of the lines, then the information regarding the network address will be read by the router which will help it in determining the destination.
Answer:
A. clients, which are the networked computers that request data
100% right!
If You're is in credit card debt, why can't you just say your card was stolen so you can avoid the debt.
The ability of a language to let a programmer develop a program on a computer system that can be run on other systems is called ________. This usually requires the program to be recompiled on each type of system, but the program itself may need little or no change.
Answer:
Virtual Machine
Explanation:
Example: JVM
Encapsulation is a form of information hiding and an important characteristic of object-oriented programming. When a programmer accesses a property that has been encapsulated, he/she has no way of knowing how that property is implemented. All he/she knows is how to access that property via the public setter and getter methods. What are some examples of encapsulation or information hiding in the Bible
There are a whole lot of encapsulation or information hiding examples in the Bible. Here are about 3 of them:
i. The parables of Jesus. Many times Jesus spoke in parables to teach His disciples and until He's explained they would not get the meaning.
ii. The interpretation of dreams by Joseph. A noticeable example is the one of the baker and the butler in Genesis 40. Each of them - the butler and the baker - both had a dream but the actual meaning and interpretation of those dreams were not known by them.
iii. Peter walking on water is yet another example of encapsulation. He was only following the instruction of the master. How he was able to walk on water was a mystery to him. Only Christ the master knew how. Encapsulation.
6.11 LAB: Sort a vector
Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The first integer
indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.
Ex: If the input is:
5 10 4 39 12 2
the output is:
2 4 10 12 39
For coding simplicity, follow every output value by a space, including the last one.
Your program must define and call the following function. When the SortVector function is complete, the vector passed in as the parameter
should be sorted.
void SortVector(vector int>& myVec)
Hint: There are many ways to sort a vector. You are welcome to look up and use any existing algorithm. Some believe the simplest to code
is bubble sort: https://en.wikipedia.org/wiki/Bubble_sort. But you are welcome to try others: https://en.wikipedia.org/wiki/Sorting_algorithm.
290064 1698536.qx3zqy7
The sort a vector program is an illustration of functions, loops and vectors or lists.
The main programThe program written in C++, where comments are used to explain each action is as follows:
#include<bits/stdc++.h>
using namespace std;
//This defines the SortVector function
void SortVector(vector <int>& myVec){
//This sorts the vector elements in ascending order
sort(myVec.begin(), myVec.end());
//This iterates through the sorted vector, and print each element
for (auto x : myVec)
cout << x << " ";
}
//The main begins here
int main(){
//This declares all the variables
int num, numInput; vector<int> v;
//This gets the length of the vector
cin>>num;
//The following iteration gets input for the vector
for(int i = 0; i<num;i++){
cin>>numInput;
v.push_back(numInput);
}
//This calls the SortVector function
SortVector(v);
return 0;
}
Read more about functions at:
https://brainly.com/question/24833629
arrange the following numbers in ascending order -2/3, 7/-18 , 5/-19
Answer:
2/3 5/19 7/18
Explanation:
Write a function that simulates the roll of a six-sided dice. The name of the function is rollDice. The function accepts no parameters and returns a pseudorandom int: 1, 2, 3, 4, 5, or 6. Write only the function, not the main program. You may assume that srand() was invoked in the main function. There should not be any cin or cout statements in the function.
Answer:
int rollDice(){
return 1 + rand() % 6;
}
Explanation:
What technique is used to store sound waves as binary numbers?
Answer:
Sound waves are analogue and therefore they need to be converted into binary in order for a computer to be able to process them. To do this, the computer must convert the waveform into a numerical representation so that the waveform can be stored digitally. For this, we use an Analogue-to-Digital Convertor (ADC).
Explanation:
Who takes Mindtap Web Design
Answer:
MindTap is a new personalized program of digital products and services that engages students with interactivity while also offering students and instructors choice in content, platform, devices, and learning tools. ... The customizable, cloud-based system is a web portal students log into to navigate via a dashboard.
Explanation:
MindTap for Minnick's Responsive Web Design with HTML 5 & CSS, 9th Edition is the digital learning solution that powers students from memorization to mastery. It gives you complete control of your course—to provide engaging content, to challenge every individual, and to build their confidence.
why does a computer system need memory
Explanation:
Computer memory is a temporary storage area. It holds the data and instructions that the Central Processing Unit (CPU) needs.
Lucy wants to add some notes in her research paper that provide additional information to the reader. She also wants to display her university logo on all the pages as part of the title. What formatting can she apply to her document to include these details?
Which is true regarding pseudocode?
It uses simple words and symbols to communicate the design of a program,
It compiles and executes code.
It expresses only complex processes.
O It gives a graphical representation of a set of instructions to solve a problem.
Answer:
It uses simple words and symbols to communicate the design of a program
Explanation:
A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.
A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications. There are seven (7) main stages in the creation of a software and these are;
1. Planning.
2. Analysis.
3. Design.
4. Development (coding).
5. Testing.
6. Implementation and execution.
7. Maintenance.
A pseudocode refers to the description of the steps contained in an algorithm using a plain or natural language. Also, a pseudocode gives a summary of the steps adopted during a software development process using simple (concise) words and symbols.
This ultimately implies that, a pseudocode uses simple words and symbols to communicate the design of a program.
Answer:
A: It uses simple words and symbols to communicate the design of a program
Explanation:
Credit to the person above me.
Which problem does IPv6 (Internet Protocol version 6) help to solve?
Answer:
Address space exhaustion
Explanation:
IPv6 (Internet Protocol version 6) was introduced in 1995. This model is faster and safer than the previous models due to the modifications done on it.
It was however introduced with the main aim of addressing space exhaustion. IPv4 addresses were already getting scarce and a new model had to be introduced to bridge the gap. IPv4 has billions of addresses however IPv6 has multiples of trillions addresses to take care of current and future needs.
**GIVING ALL POINTS** 4.02 Coding With Loops
I NEED THIS TO BE DONE FOR ME AS I DONT UNDERSTAND HOW TO DO IT. THANK YOU
Output: Your goal
You will complete a program that asks a user to guess a number.
Part 1: Review the Code
Review the code and locate the comments with missing lines (# Fill in missing code). Copy and paste the code into the Python IDLE. Use the IDLE to fill in the missing lines of code.
On the surface this program seems simple. Allow the player to keep guessing until he/she finds the secret number. But stop and think for a moment. You need a loop to keep running until the player gets the right answer.
Some things to think about as you write your loop:
The loop will only run if the comparison is true.
(e.g., 1 < 0 would not run as it is false but 5 != 10 would run as it is true)
What variables will you need to compare?
What comparison operator will you need to use?
# Heading (name, date, and short description) feel free to use multiple lines
def main():
# Initialize variables
numGuesses = 0
userGuess = -1
secretNum = 5
name = input("Hello! What is your name?")
# Fill in the missing LOOP here.
# This loop will need run until the player has guessed the secret number.
userGuess = int(input("Guess a number between 1 and 20: "))
numGuesses = numGuesses + 1
if (userGuess < secretNum):
print("You guessed " + str(userGuess) + ". Too low.")
if (userGuess > secretNum):
print("You guessed " + str(userGuess) + ". Too high.")
# Fill in missing PRINT statement here.
# Print a single message telling the player:
# That he/she guessed the secret number
# What the secret number was
# How many guesses it took
main()
Part 2: Test Your Code
Use the Python IDLE to test the program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Run your program to ensure it is working properly. Fix any errors you observe.
Example of expected output: The output below is an example of the output from the Guess the Number game. Your specific results will vary based on the input you enter.
Output
Your guessed 10. Too high.
Your guessed 1. Too low.
Your guessed 3. Too low.
Good job, Jax! You guessed my number (5) in 3 tries!
When you've completed filling in your program code, save your work by selecting 'Save' in the Python IDLE.
When you submit your assignment, you will attach this Python file separately.
Part 3: Post Mortem Review (PMR)
Using complete sentences, respond to all the questions in the PMR chart.
Review Question Response
What was the purpose of your program?
How could your program be useful in the real world?
What is a problem you ran into, and how did you fix it?
Describe one thing you would do differently the next time you write a program.
Answer:
sorry man
Explanation:
How many binary digits does a single hexadecimal digit represent?
Four binary digits
A single hexadecimal digit can represent four binary digits.
What is the output of the following code segment?
String[] cs = "Elon Musk founded SpaceX on May 6, 2002.".split(" ");
System.out.println(cs.length);
Answer:
8
Explanation:
paki sagot po kailangan ko na po Kasi Yan ngayon and I follow po Kita f ma answer mo nang Tama!❤️
Answer:
1. Mali
2. Tama
3.tama
4. Tama
5. tama
Answer:
1. Mali
2. Tama
3.tama
4. Tama
5. tama
Explanation:
other person got it ;)
what are the qualitative data items about text book
Answer:
Qualitative data is defined as the data that approximates and characterizes. Qualitative data can be observed and recorded. ... This type of data is collected through methods of observations, one-to-one interviews, conducting focus groups, and similar methods.
21. The most overlooked people in information security are:
A consultants and temporary hires.
B. secretaries and consultants.
C. contract laborers and executive assistants.
D. janitors and guards.
E. executives and executive secretaries.
Answer: D. janitors and guards
Explanation:
Information security simply means the protection of information from an unauthorized use or access.
The most overlooked people in information security are the janitors and the guards. Due to the fact that they're at the bottom of the organizational chart, they tend to be overlooked and not given the respect that they deserve.