The calculator program is an illustration of iteration (loop) and conditional statements
What are iterations?Iterations are program statements that are used to perform repetition operations
What are conditional statements?Conditional statements are statements used to make decisions
The main programsThe program written in Python, where comments are used to explain each action is as follows:
#This initializes the subtotal and total to 0
subTotal = 0; total = 0
#This initializes the previous number to an empty list
prevNum = []
#This iteration is repeated for valid inputs
while True:
#This gets the input from the user
num = int(input())
#This calculates the subtotal
subTotal+=num
#This calculates the total
total+=num
#If the current input is 0
if num == 0:
#This prints the sub total
print("Subtotal:",subTotal)
#This sets the sub total to 0
subTotal = 0
#If the previous number is empty
if len(prevNum) == 0:
#This sets it to the current input
prevNum.append(num)
#If otherwise
else:
#If the previous number and the current input are 0
if(prevNum[0] == 0 and num == 0):
#This prints the total input
print("Total:",total)
#This exits the loop
break
#If otherwise
else:
#This sets the previous number to the current input
prevNum[0] = num
Read more about similar programs at:
https://brainly.com/question/26497128
what is falg register
Answer:
I dont know the answer
Explanation:
I dont know the answer
my uh coding teacher would like the class to do little piggy with code.
Write code using def to create functions so that each line is printed in its own function. Turn in a gdb link so I can grade it.
This little pig went to the market.
This little pig stayed home.
This little pig had roast beef.
This little pig had none.
This little pig cried wee wee wee all the way home.
here's a example from him but i don't understand it
import time
def myFunction():
print('In the function called my function')
time.sleep(2)
def yourFunction():
print('In the function called your function')
time.sleep(2)
#*********MAIN**********
print ('In the main part of the program')
time.sleep(2)
myFunction()
print ('Back in the main')
time.sleep(2)
yourFunction()
print ('Back in the main after your function')
please help if you can
Answer:
see picture below
Explanation:
I added a parameter to factor out the first bit of each sentence into a global variable. If you change for example 'pig' into 'monkey', all sentences will change.
I need help to pick what programming language is best to make videogames
Answer:
In my opion its java script
Explanation:
What kinds of animations are available for slide objects besides animations for entrances and exists?
The information in DNA Is coded in chemical bases adenosine (A) guanine (G) cytosine (C), and thymine (T) We can represent a DNA strand by stringing together the letters representing the appropriate strand. Imagine we are given a list of DNA strands which have arbitrary lengths. Write a single function strand_counter() which takes a list of DNA strands, counts the lengths of each of the words in the list and then calculates and returns the integer maximum_length integer minimum_length, and float average_length
Then write a program which takes in a user-chosen number of strands of arbitrary length as an input and prints out the calculated information
Example input
5
AT
ATCGTCOGGT
TCGCT
TCGATTCCT
TTCATCG
Example output
The longest strand has length 10.
The shortest strand has length 2.
The average length of the strands is 6.6.
Answer:
c
Explanation:
i think i leard it out my old shcool
If we ignore the audio data in a video file, a video file is just a collection of many individual frames (i.e., images). What is the main reason that a video file can achieve a much higher compression ratio than a file that contains a single image file?
Answer:
It is compressing the video file to make it smaller, but doing so without actually losing any quality
Explanation:
The main reason for a video file that can achieve a much higher compression ratio than a file that contains a single image file is that it can reduce the size of the file without affecting its quality.
What is Video compression?Video compression may be defined as a type of methodology that is significantly utilized in order to decline the size of a video file or alter the formatting of the video without compromising its quality.
The process of compression effectively permits you to reduce the number of storage resources that are needed to store videos and save costs. The importance of video compression includes smaller overall file sizes.
Therefore, the main reason for a video file that can achieve a much higher compression ratio than a file that contains a single image file is that it can reduce the size of the file without affecting its quality.
To learn more about Video compression, refer to the link:
https://brainly.com/question/28078112
#SPJ2
dy
If x2 - y2 = 1, then
dx
1
(a) yx-1
(C) xy-1
(b) -xy-
(d) - yx
Answer:
xy-1
Explanation:
Given expression is :
[tex]x^2-y^2=1[/tex] ..(1)
We need to find the value of [tex]\dfrac{dy}{dx}[/tex].
Differentiating equation (1) wrt x.
[tex]\dfrac{d}{dx}(x^2-y^2)=1\\\\2x-2y\times \dfrac{dy}{dx}=0\\\\2y\times \dfrac{dy}{dx}=2x\\\\y\times \dfrac{dy}{dx}=x\\\\\dfrac{dy}{dx}=\dfrac{x}{y}[/tex]
or
[tex]\dfrac{dy}{dx}=xy^{-1}[/tex]
Hence, the correct option is (c) "xy-1".
Which visual aid best matches each description given?
population clusters within a particular country
✔ map
a cross-section of a cell membrane
✔ line drawing
the changes in cell-phone usage from 2000 to the present
✔ graph
an outline of the order of topics given in the speech
✔ handout
The options given above are all correct about the visual aid that best matches each description given.
What are Visual aids?These are known to be any kind of thing or an instrument that is often used to portray an item or one that helps people to know something or to remember something.
Conclusively, population clusters within a particular country can be depicted on a map as well as the other options are also correct.
Learn more about visual aid from
https://brainly.com/question/3610367
"We can't a computer use source code
Answer:
Explanation:
There are two main reasons why you can't access the source code from applications on your computer: It isn't present on your computer. The source code isn't really needed to run the application, the executable is (.exe) The executable is just a bunch of machine code stuff that isn't human readable.
Which of these is a problem that a computer CANNOT solve
A. Getting the news out to the public quickly
B. Helping architects build models of new buildings
C. Getting rid of racism
D. Making a game for entertainment
Write a program in QBasic to enter two numbers and print the greater one.
Answer:
REM
CLS
INPUT “ENTER ANY TWO NUMBERS”; A, B
IF A > B THEN
PRINT A; “IS GREATER”
ELSE
PRINT B; “IS GREATER”
END IF
END
class one
{
public static void main ( )
{
int a = 1,b = 2;
if ( a > b )
{
System.out.print (" greater number is " + a);
}
else if ( a < b )
{
System.out.print (" greater number is " + b);
}
}
}
Given A=1101 and B=1001. What is the result of the boolean statement: A
AND B
Answer:
B (1001)
Explanation:
The AND operator gets you 1's where there are 1's in both inputs. So if you would "overlay" the two binary values, only 1001 remains.
what is a cross-site scripting (XSS) attack?
An XSS is a common type of online attack targeting web applications and websites, the attack manipulates the web application or website to give the user client-side scripts to install malware, obtain financial information or send the user to more malicious sites.
There are many types of XSS attacks including:
Reflected XSS Stored XSS DOM-based XSSHow do I create a flowchart to output numbers from n...1? We were doing loops during the classes.
I use GOxxOGLE FORMS or WxxORDS and their good to make flow charts
Q.2 (A)
Write down the method for cooking pasta from the given ingredients.
% CUP
Ingredients and amounts
Dried pasta
Butter
Amul cheese spread
Milk
Salt
1 tablespoon
2-3 tablespoon
Va cup
pinch
ach line contains a letter o
Answer:
First u need to soften pasta by boiling it .
Butter 1 tablespoon.
Then Fry wet pasta , And add veggies or spices
When it's about to prepare ,
Add Amul cheese ( if u want to make cheese pasta)
Add a pinch of salt ( if u want) not necessary.
Milk is not necessary though.
I hope this helps a little bit
You have many drugs that you want to store electronically along with their purchase dates and prices, what kind of software would you use? *
Wordprocessing
Database
Presentation
Spreadsheet
Answer:
Database
Explanation:
To store a variety of drugs electronically, along with displaying their purchase dates and prices, the kind of software that would be used is database.
(python) Given the formula for conversion from Celsius to Fahrenheit
Fahrenheit = 1.8 x Celsius + 32
Write a Python program that takes as input a temperature in degrees Celsius, calculates the temperature in degrees Fahrenheit, and display the result as output.
Answer:
initial_temp = float(input('Celsius Temperature: '))
final_temp = (initial_temp * 1.8) + 32
print(f'{final_temp} F')
Explain, step by step the process required to carry out drive error correction (disk check) on Windows 10
Explanation:
Disk Error Checking in Windows 10
In Windows 8, Microsoft has redesigned chkdsk utility – the tool for detecting and fixing disk corruption. In Windows 8, Microsoft introduced a file system called ReFS, which does not require an offline chkdsk to repair corruptions – as it follows a different model for resiliency and hence does not need to run the traditional chkdsk utility.
The disk is periodically checked for file system errors, bad sectors, lost clusters, etc., during Automatic Maintenance and you now no longer need to really go and run it. In fact, Windows 8 now even exposes the state of the file-system and disk via the Action Center or under the Drive properties in File Explorer. If potential errors are found, you will be informed about it. You can continue to use the computer, while the scan is carried out in the background. If errors are found, you may be prompted via a notification to restart your computer.
Read: How to cancel ChkDsk in Windows.
Windows found errors on this drive that need to be repaired
At times you may see a message – Windows found errors on this drive that need to be repaired. If you see it, you may want to manually run a scan. Earlier you had to schedule Disk Error Checking for the system drive and for drives which had files or processes or folders opened. In Windows 10/8, error checking starts right away, even on the system drive – and it longer needs to be scheduled at start-up. Only if some errors are found, will you have to restart to let Windows 10/8 fix the errors.
How to run CHKDSK in Windows 10
To begin the scan, right-click on the Drive which you wish to check and select Properties. Next, click on Tools tab and under Error-checking, click on the Check button. This option will check the drive for file system errors.
If the system detects that there are errors, you will be asked to check the disk. If no errors are found, you will see a message – You don’t need to scan this drive. You can, nevertheless, choose to check the drive. Click on Scan drive to do so.
As in previous prelabs, you can enter all the necessary Java code fragments into the DrJava Interactions pane. If you get an error, enter the corrected code. If you get really mixed up, you can reset the interactions pane and try again. Write a while loop that computes the sum of the first 10 positive integers. Write a for loop that computes the sum the first 10 positive integers. For each loop, you should use two variables. One that runs through the first 10 positive integers, and one that stores the result of the computation. To test your code, what is the sum of the first 10 positive integers
Answer:
public class Main{
public static void main(String[] args) {
//The While Loop
int i = 1;
int sum = 0;
while(i <=10){
sum+=i;
i++; }
System.out.println("Sum: "+sum);
//The for Loop
int summ = 0;
for(int j = 1;j<=10;j++){
summ+=j; }
System.out.println("Sum: "+summ); } }
Explanation:
The while loop begins here
//The While Loop
This initializes the count variable i to 1
int i = 1;
This initializes sum to 0
int sum = 0;
This while iteration is repeated until the count variable i reaches 10
while(i <=10){
This calculates the sum
sum+=i;
This increments the count variable i by 1
i++; }
This prints the calculated sum
System.out.println("Sum: "+sum);
The for loop begins here
//The for Loop
This initializes sum to 0
int summ = 0;
This iterates 1 through 10
for(int j = 1;j<=10;j++){
This calculates the sum
summ+=j; }
This prints the calculated sum
System.out.println("Sum: "+summ); }
Use the drop-down menus to match each description to its corresponding term.
millions of tiny dots on a computer screen
number of pixels that span an image’s width multiplied by its height
pixels mapped onto an X-Y coordinate plane
Answer:
Your answer is
Explanation:
A monitor's screen is divided up into millions of tiny dots, called ________. Select your answer, then click Done.
You chose pixels, clicked the Done button.
Abby has a research paper to write and doesn't know which sites provide quality information. Which of the following sites is the best site for a research paper? Click the image(s) to select the answer. When you are finished, click Done.
You selected the College Online Library option, clicked the Done button.
Answer:
millions of tiny dots on a computer screen
✔ pixels
number of pixels that span an image’s width multiplied by its height
✔ image resolution
pixels mapped onto an X-Y coordinate plane
✔ raster graphic
Get it ig
how are headers and footers are useful in presentation
Answer:
Explanation:
PowerPoint is a software that allows user to create headers as well as footers which are information usually appears at the top of the slides and the information that appears at the bottom of all slides. Headers and footers are useful when making presentation in these ways:
✓ Both provide quick information about one's document/ data clearly in a predictable format. The information that is provided by the Header and footers typically consist of ;
©name of the presenters,
©the presentation title
©slide number
©date and others.
✓ They help in setting out different parts of the document.
✓Since the Headers and footers can appear on every slide, corporate confidentiality as well as copyright information can be added to footer area to discourages those that can steal ones secrete.
explain five unique features of word processor
Explanation:
Typing, editing and printing different types of document . Formatting text , paragraph , pages for making attractive document .Checking spelling and grammar of document for making it error free.Inserting and editing picture , objects,etc. Adding watermark, charts,quick flip , etc1) Easy Typing : In MS Word, typing is so easy because :
we need not click enter button after the end of a line as in case of type writer. The word processor itself takes the matter to the next line of the document. This facility is called word wrapping.There is no limit for typing the matter in word processing. You can type the matter continuously without resorting to new page or file. But in a type writer, if you complete a page, you have to take another blank page and start typing.You can easily rectify mistakes as the typed matter appears on the screen.2) Easy : The document so typed can be stored for future use. The process of storing is called saving. We can preserve the document for any number of years in word processing.
3) Adding, Removing and Copying Test : Documents can be modified easily in MS Office. We need not strike off any word as in the case of type writer. We can easily place a new word in place of existing one. The new word or paras will automatically be adjusted in the place of deleted or modified text. We can also copy a part or whole of the matter from one file or document to another document.
4) Spell Check of words : The spellings of words in the document can be rectified automatically. We can find alternative words to our typed words. Not only that, even the grammatical errors can also be rectified in word processor.
5) Change the Style and Shape of Characters and Paragraphs : The documents in word processor can be made attractive and appealing because the shape and style of characters or letters in the documents can be changed according to our requirements. You can even change the gap between one line and other line in the document. This process is called line spacing. Not only the lines but also paragraphs can be aligned to make it more appealing to the readers. This facility is called alignment in word processing.
HOPE IT HELPS
PLEASE MARK ME BRAINLIEST ☺️
This is for school. The teacher told us to make a song. Here is mine plz be honest and tell me if it is good or not. Plz be honest
So now that we r friends we can all shake hands. I’m glad the bad things r off my mind because I can get back to my grind yeah. So now I feel free can’t you see. Yeah, I’m happy. Yeah, I’m happy yeah. Yeah, I’m happy. Yeah, I’m happy yeah. Now back to the beat while I sit in my seat and get something to eat. Yeah… Uh huh. LET’S GO! So, as I’m walking down the street, I feel free Uh. Don’t play with me yeah. Don’t act like a clown in my hometown. U wana be frowning because I made a touchdown. Maaaaaaaan STOP HATIN. U wana hate go get u a plate. Oh wait... you can’t get a plate. Driving in my car aint going to far. Gona hit the... dance bar! Dance on the floor gona break the door. Alright I’m tired time to go home and play on my phone.
Answer:
it's funny I honestly like it I guess it just depends on if your teacher has a sense of humor
AND ALL THE BEST FOR YOUR SONG....
Structural Styles
Go to the Structural Styles section. Within that section create a style rule to set the background color of the browser window to rgb(151, 151, 151).
Create a style rule to set the background color of the page body to rgb(180, 180, 223) and set the body text to the font stack: Verdana, Geneva, sans-serif.
Display all h1 and h2 headings with normal weight.
Create a style rule for every hypertext link nested within a navigation list that removes underlining from the text.
Create a style rule for the footer element that sets the text color to white and the background color to rgb(101, 101, 101). Set the font size to 0.8em. Horizontally center the footer text, and set the top/bottom padding space to 1 pixel.
Solution :
For Structural Styles the browser's background color.
html {
background-color: rgb(151, 151, 151);
}
For creating style rule for the background color and setting the body text
body {
background-color: rgb(180,180,223);
font-family: Verdana, Geneva, sans-serif;
}
For displaying all the h1 as well as h2 headings with the normal weight.
h1, h2 {
font-weight: normal;
}
For create the style rule for all the hypertext link that is nested within the navigation list
nav a {
text-decoration: none;
}
For creating style rule for footer element which sets the color of the text to color white and the color of the background to as rgb(101, 101, 101). Also setting the font size to 0.8em. Placing the footer text to horizontally center , and setting the top/bottom of the padding space to 1 pixel.
footer {
background-color: rgb(101, 101, 101);
font-size: 0.8em;
text-align: center;
color: white;
padding: 1px 0;
}
/* Structural Styles At one place*/
html {
background-color: rgb(151, 151, 151);
}
body {
background-color: rgb(180,180,223);
font-family: Verdana, Geneva, sans-serif;
}
h1, h2 {
font-weight: normal;
}
nav a {
text-decoration: none;
}
footer {
background-color: rgb(101, 101, 101);
font-size: 0.8em;
text-align: center;
color: white;
padding: 1px 0;
}
Explain how data is represent in the computer system
Explanation:
Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of binary digits (bits), eg the binary number 1001.Write a full class definition for a class named GasTank , and containing the following members:
A data member named amount of type double.
A constructor that no parameters. The constructor initializes the data member amount to 0.
A function named addGas that accepts a parameter of type double . The value of the amount instance variable is increased by the value of the parameter.
A function named useGas that accepts a parameter of type double . The value of the amount data member is decreased by the value of the parameter. However, if the value of amount is decreased below 0 , amount is set to 0 .
A function named isEmpty that accepts no parameters and returns a boolean value. isEmpty returns a boolean value: true if the value of amount is less than 0.1 , and false otherwise.
A function named getGasLevel that accepts no parameters. getGasLevel returns the value of the amount data member.
class GasTank
{
private:
double amount;
public:
GasTank();
void addGas(double);
void useGas(double);
bool isEmpty();
double getGasLevel();
};
GasTank::GasTank(){amount = 0;}
void GasTank::addGas(double a){amount += a;}
void GasTank::useGas(double a){amount -= a; if (amount < 0) amount = 0; }
bool GasTank::isEmpty(){if(amount < .1) return true; else return false;}
double GasTank::getGasLevel() {return amount;}
Answer:
Explanation:
The following class code is written in Java and includes all of the required methods as requested in the question...
package sample;
class GasTank {
private double amount = 0;
private double capacity;
public GasTank(double initialAmount) {
this.capacity = initialAmount;
}
public void addGas(double addAmount) {
this.amount += addAmount;
if (amount > capacity) {
amount = capacity;
}
}
public void useGas(double subtractAmount) {
this.amount -= subtractAmount;
if (amount < 0) {
amount = 0;
}
}
public boolean isEmpty() {
return (amount < 0.1);
}
public boolean isFull() {
return (amount > capacity - 0.1);
}
public double getGasLevel() {
return amount;
}
public double fillUp() {
double difference = capacity - amount;
amount = capacity;
return difference;
}
}
How can we make our programs behave differently each time they are run?
Answer:
By given the right speech as much as the answers must be
Explanation:
By given the right speech as much as the answers must be
Use the drop-down menus to complete each of the following sentences correctly.
To include someone on an e-mail without others knowing, use the
feature.
Use the
feature to send a file.
Use the
feature to send someone else an e-mail you received.
To allow the main recipient of an e-mail to see who is being included in the message, use the
feature.
is a feature that can be used to respond to someone’s e-mail.
Answer:
Blind carbon copy (abbreviated Bcc)
Click on the menu item with a paperclip icon that says "Attach a file" or something similar (e.g., "Attach Files")
Click Reply and then select Forward
CC
reply
Please use the tables in the flights database. Your deliverable should include a single SQL query that I can run against a "fresh copy" of the tables in the flights database.
1. Write a script to select all data from the planes table.
2. Update the planes table so that rows that have no year will be assigned the year 2013. (missing values will display as NULL).
3. Insert a new record to the planes table with the following values:
Tailnum: N15501
Year: 2013
type: Fixed wing single engine
Manufacturer: BOEING
Model: A222-101
Engines: 3
Seats: 100
Speed: NULL (notice this is not a text value but truly the absence of any value: "empty". As such, don't use single or double quotes around NULL when inserting this value).
Engine: Turbo-fan
4. Delete the newly inserted record on step 3.
Answer:
The scripts are:
1. SELECT * FROM planes
2. UPDATE planes SET YEAR = 2013 WHERE year IS NULL
3. INSERT INTO planes (Tailnum, Year, type, Manufacturer, Model, Engines, Seats) VALUES ('N15501',2013,'Fixed wing single engine', 'BOEING', 'A222-101',3,100,NULL)
4. DELETE FROM planes WHERE Tailnum = 'N15501'
Explanation:
1. SELECT * FROM planes
To select all from a table, use select * from [table-name]. In this case, the table name is planes
2. UPDATE [tex]planes\ SET[/tex] YEAR = 2013 WHERE year IS NULL
To do this, we use the update query which is as follows:
UPDATE [table-name] SET [column-name]= [value] WHERE [column] IS NULL
So: the above query will update all YEAR column whose value is NULL to 2014
3. INSERT INTO planes (Tailnum, Year, type, Manufacturer, Model, Engines, Seats) VALUES ('N15501',2013,'Fixed wing single engine', 'BOEING', 'A222-101',3,100,NULL)
To insert is very straight foward.
The syntax is:
INSERT INTO [table-name] (column names) VALUES (values)
4. DELETE FROM planes WHERE Tailnum = 'N15501'
To do this, we use the update query which is as follows:
DELETE FROM [table-name] WHERE [column] = [value]
So: The above query will delete the entry in (3) above
I like the impact that the increasing number of social grants may have on the things mothers
Answer:
yes. i do too.
Explanation: