Answer:
RAM (Random access memory)helps in reading aswell as writing data
Write a program named palindromefinder.py which takes two files as arguments. The first file is the input file which contains one word per line and the second file is the output file. The output file is created by finding and outputting all the palindromes in the input file. A palindrome is a sequence of characters which reads the same backwards and forwards. For example, the word 'racecar' is a palindrome because if you read it from left to right or right to left the word is the same. Let us further limit our definition of a palindrome to a sequence of characters greater than length 1. A sample input file is provided named words_shuffled. The file contains 235,885 words. You may want to create smaller sample input files before attempting to tackle the 235,885 word sample file. Your program should not take longer than 5 seconds to calculate the output
In Python 3,
MY CODE: palindromefinder.py
import sys
def is_Palindrome(s):
if len(s) > 1 and s == s[::-1]:
return true
else:
return false
def main():
if len(sys.argv) < 2:
print('Not enough arguments. Please provide a file')
exit(1)
file_name = sys.argv[1]
list_of_palindrome = []
with open(file_name, 'r') as file_handle:
for line in file_handle:
lowercase_string = string.lower()
if is_Palindrome(lowercase_string):
list_of_palindrome.append(string)
else:
print(list_of_palindrome)
If you can adjust my code to get program running that would be ideal, but if you need to start from scratch that is fine.
Open your python-3 console and import the following .py file
#necessary to import file
import sys
#define function
def palindrome(s):
return len(s) > 1 and s == s[::-1]
def main():
if len(sys.argv) < 3:
print('Problem reading the file')
exit(1)
file_input = sys.argv[1]
file_output = sys.argv[2]
try:
with open(file_input, 'r') as file open(file_output, 'w') as w:
for raw in file:
raw = raw.strip()
#call function
if palindrome(raw.lower()):
w.write(raw + "\n")
except IOError:
print("error with ", file_input)
if __name__ == '__main__':
main()
(PYTHON)
Ask the user if they want to multiply two numbers entered from the keyboard. If they type "YES" ask for two numbers and multiply them. What happens if they type Yes, yes, yes, try a few combinations.
I hope this helps! If you have anymore questions, I'll do my best to answer them.
The IP address and the port are both numbers. Which statement is true?
A computer has many IP addresses and many ports.
A computer has one IP address and many ports.
A computer has one IP address and one port,
Acomputer has many IP addresses and one port.
Answer:
A computer has one IP address and many ports.
Explanation:
Answer:
A computer has one IP address and many ports.
Explanation:
Write the SQL queries that accomplish the following tasks in the HAFH Realty Company Property Management Database:
The complete question is:
Write the SQL queries that accomplish the following tasks in the HAFH Realty Company Property Management Database:
a. Display the SMemberID and SMemberName for all staff members.
b. Display the CCID, CCName, and CCIndustry for all corporate clients.
c. Display the BuildingID, BNoOfFloors, and the manager’s MFName and MLName for all buildings.
d. Display the MFName, MLName, MSalary, MBDate, and number of buildings that the manager manages for all managers with a salary less than $55,000.
e. Display the BuildingID and AptNo, for all apartments leased by the corporate client WindyCT.
f. Display the InsID and InsName for all inspectors whose next inspection is scheduled after 1-JAN-2014. Do not display the same information more than once.
g. Display the SMemberID and SMemberName of staff members cleaning apartments rented by corporate clients whose corporate location is Chicago. Do not display the same information more than once.
h. Display the CCName of the client and the CCName of the client who referred it, for every client referred by a client in the music industry.
i. Display the BuildingID, AptNo, and ANoOfBedrooms for all apartments that are not leased.
Also a schema of the HAFH database is attached.
Answer:
Using SQL's SELECT, FROM, WHERE syntax, find below the queries for each question.
a.
SELECT SMemberID , SMemberName
FROM staffmember
b.
SELECT CCID, CCName, CCIndustry
FROM corpclient
c.
SELECT b.BuildingID, b.BNoOfFloors, m.MFName, m.MLName
FROM building b, manager m
WHERE b.ManagerID = m.ManagerID
d.
SELECT m.MFName, m.MLName, m.MSalary, m.MBDate, count(*) as buildings
FROM building b, manager m
WHERE m.MSalary<55000
AND b.ManagerID = m.ManagerID
GROUP BY m.ManagerID
e.
SELECT b.BuildingID, a.AptNo
FROM building b, apartment a, corpclient c
WHERE c.CCName = "WindyCT"
AND c.CCID = a.CCID
AND a.BuildingID = b.BuildingID
f.
SELECT DISTINCT i.InsID, i.InsName
FROM inspector i, inspecting x
WHERE i.InsID = x.InsID
AND x.DateNext > "2014-01-01"
g.
SELECT DISTINCT s.SMemberID, s.SMemberName
FROM staffmember s, cleaning c, apartment a, corpclient cc
WHERE s.SmemberID = c.SmemberID
AND c.AptNo = a.AptNo
AND a.CCID = cc.CCID
AND cc.CCLocation = "Chicago"
h.
SELECT cc1.CCName, cc2.CCName
FROM corpclient cc1, corpclient cc2
WHERE cc1.CCIDReferencedBy = cc2.CCID
AND cc2.CCIndustry = "Music"
i.
SELECT a.BuildingID, a.AptNo, a.ANoOfBedrooms
FROM apartment a
WHERE a.CCID NOT IN (SELECT c.CCID FROM corpclient c)
Carlie was asked to review a software project for her company to determine specific deadlines. Which part of project management must she consider?
Analysis
Resources
Scope
Time
Answer:
Resources
Explanation:
Answer:
scope
Explanation:
Which of the following is another word for a copyeditor?
microeditor
macroeditor
assignment editor
assistant editor
Answer: speaking of microeditor
Explanation: thats not the only thing i know of thats micro :0
14. Convert 11110111 from binary to denary
(1 Point)
converting 11110111 from binary to denary = 247
Answer:
247
Explanation:
Write some code that assigns True to the variable is_a_member if the value assigned to member_id can be found in the current_members list. Otherwise, assign False to is_a_member. In your code, use only the variables current_members, member_id, and is_a_member.
Answer:
current_members = [28, 0, 7, 100]
member_id = 7
if member_id in current_members:
is_a_member = True
else:
is_a_member = False
print(is_a_member)
Explanation:
Although it is not required I initialized the current_members list and member_id so that you may check your code.
After initializing those, check if member_id is in the current_members or not using "if else" structure and "in" ("in" allows us to check if a variable is in a list or not). If member_id is in current_members, set the is_a_member as True. Otherwise, set the is_a_member as False.
Print the is_a_member to see the result
In the example above, since 7 is in the list, the is_a_member will be True
Implement a class Balloon that models a spherical balloon that is being filled with air. The constructor constructs an empty balloon. Supply these methods:
void addAir(double amount) adds the given amount of air.
double getVolume() gets the current volume.
double getSurfaceArea() gets the current surface area.
double getRadius() gets the current radius.
Supply a BalloonTester class that constructs a balloon, adds 100cm^3 of air, tests the three accessor methods, adds another 100cm3 of air, and tests the accessor methods again.
Answer:
Here is the Balloon class:
public class Balloon { //class name
private double volume; //private member variable of type double of class Balloon to store the volume
public Balloon() { //constructor of Balloon
volume = 0; } //constructs an empty balloon by setting value of volume to 0 initially
void addAir(double amount) { //method addAir that takes double type variable amount as parameter and adds given amount of air
volume = volume + amount; } //adds amount to volume
double getVolume() { //accessor method to get volume
return volume; } //returns the current volume
double getSurfaceArea() { //accessor method to get current surface area
return volume * 3 / this.getRadius(); } //computes and returns the surface area
double getRadius() { //accessor method to get the current radius
return Math.pow(volume / ((4 * Math.PI) / 3), 1.0/3); } } //formula to compute the radius
Explanation:
Here is the BalloonTester class
public class BalloonTester { //class name
public static void main(String[] args) { //start of main method
Balloon balloon = new Balloon(); //creates an object of Balloon class
balloon.addAir(100); //calls addAir method using object balloon and passes value of 100 to it
System.out.println("Volume "+balloon.getVolume()); //displays the value of volume by getting value of volume by calling getVolume method using the balloon object
System.out.println("Surface area "+balloon.getSurfaceArea()); //displays the surface area by calling getSurfaceArea method using the balloon object
System.out.println("Radius "+balloon.getRadius()); //displays the value of radius by calling getRadius method using the balloon object
balloon.addAir(100); //adds another 100 cm3 of air using addAir method
System.out.println("Volume "+balloon.getVolume()); //displays the value of volume by getting value of volume by calling getVolume method using the balloon object
System.out.println("Surface area "+balloon.getSurfaceArea()); //displays the surface area by calling getSurfaceArea method using the balloon object
System.out.println("Radius "+balloon.getRadius()); } } //displays the value of radius by calling getRadius method using the balloon object
//The screenshot of the output is attached.
What is the difference between Information Technology and Communication Technology?
Answer:
Explanation:
information tech is technology that teaches you information, and communication tech is tech that lets you talk to family and friends and meet new people.
Answer:
The main difference between information technology and communication technology is that Information technology is a subject that is use of computers to store, retrieve, transmit and manipulate data, or information, often in the context of business or other enterpise whereas a Communication technology is the use of computers to communicate with family and friends.
Your game design company has recently asked all employees to use a specific personal information management application (PIM) to increase workplace efficiency. The PIM is collaborative, so contacts, calendar entries, and notes are shared across the team. Several team members are resistant to the idea, saying it interrupts their workflow, and they prefer their own way of handing contacts, notes, etc. Others don’t want their own notes to be seen by their coworkers.
Answer:For example, an office worker might manage physical documents in a filing cabinet by placing them in folders organized alphabetically by project name, or might manage digital documents in folders in a hierarchical file system.
Explanation:
what specific Philippine law discusses copyright? elaborate?
Answer: Republic Act No. 8293 "Intellectual Property Code of the Philippines".
Explanation:
The Republic Act No. 8293 is the Intellectual Property Code of the Philippines. It is the Philippine law that discusses copyright. This law protects copyrights, intellectual property, trademarks, and patents.
Examples of copyright that are protected under the law are photographic works, drawings, audiovisual works, and cinematographic works.
Low level security is designed to detect and impede _____ some unauthorized external activity Some None Most All
Answer:
Low-level security is designed to detect and impede some unauthorized external activity.
Examples of low-level security systems include:
Basic physical obstacles to defense Locks for increased-security Simple lighting coverage Standard alarm SystemsExplanation
Protection devices that prevent and track any unwanted external actions are called Low-Level security measures.
Other obstacles to the installation of the security system, such as reinforced doors, fences, high-security locks, and window bars and grates, are often installed after simple physical protection barriers and locks have been created.
Also, a simple lighting system that could not be more complex than the standard security lighting systems over windows and doors and a regular security warning system that will be an unattended unit that offers monitoring capability and sound warnings at the location of unwanted entry.
Storage facilities, convenience shops, and small business premises are some of the locations that incorporate low-level security devices.
Cheers
Before inserting a preformatted table of contents, what must you do first?
apply heading styles to text
update the table of contents
navigate to the Review tab and the Table of Contents grouping
navigate to the Insert Table of Contents dialog box
Answer: apply heading styles to text.
Explanation:
2. Which of the following fonts is most legible for a block of text? What font size and color would you choose if you were writing a block of text in a formal business document? (1 point)
Answer:
Color: Black
Font: Times New Roman
Size: 12
Explanation:
Answer:
Times new roman
front 12
color:black
Explanation:
Times new roman
front 12
color:black
The Goal: Similar to the first project, this project also uses the random module in Python. The program will first randomly generate a number unknown to the user. The user needs to guess what that number is. (In other words, the user needs to be able to input information.) If the user’s guess is wrong, the program should return some sort of indication as to how wrong (e.g. The number is too high or too low). If the user guesses correctly, a positive indication should appear. You’ll need functions to check if the user input is an actual number, to see the difference between the inputted number and the randomly generated numbers, and to then compare the numbers.• Concepts to keep in mind: • Random function• Variables• Integers• Input/Output• Print• While loops• If/Else statements
Answer:
Here is the Python program:
import random #to generate random numbers
def generateRandNo(): #function to generate random number
randNo = random.randint(1,100) #generates random number in range from 1 to 100
return randNo #returns the generated random number
def userInput(message = "Guess the number "): #to gets integer input from user and return the input number
userGuess = int(input(message)) #store the int type input from user in userGuess variable
return userGuess #returns the user input number
def compareNumbers(userGuess,randNo): #compares the user input with actual randomly generated number
if userGuess > randNo: # if user input is greater than actual number
return "The number is too high"
elif userGuess < randNo: #if user input is less than actual number
return "The number is too low"
else: #if user guess is correct
return "Correct"
def main(): #main method
correct = False #sets correct to False
begin = True #sets start game i.e. begin to True
while correct or begin: #while loop keeps repeating as long as user guess is correct or user wants to start game again
guessCount = 0 #counts number of trials user takes to guess the correct number
randNo = generateRandNo() #generates a random number using generateRandNo
userGuess = userInput() #gets input number from user using userInput method
guessCount+=1 #increments at each guess made by user
message = compareNumbers(userGuess,randNo) #compares user guess input number with actual number
while message != "Correct" : # while message is not equal to Correct
print(message) #prints to guess the number
userGuess = userInput("Try again: ") #keeps asking user to try again and enter a number
guessCount = guessCount + 1 #increments guessCount by 1 at each guess made by user
message = compareNumbers(userGuess,randNo) #compares user input with actual number
print()
print(message,"It took you ",guessCount," attempts to answer\n") #prints how much trials user took to guess correct number
choice = input("Do you wish to continue? (Enter yes or no) ") #asks user if user wants to start over
if choice == 'no': # if user enters no
exit(1) #exits the program
else: #if user enters yes starts the game again
correct = True #sets correct guess to True
main() #calls main method to start the guess game
Explanation:
The program is well explained in the comments attached with each line of the code. Suppose the randomly generated number (actual number) is 50 and user input is 24 then message The number is too low is displayed and if user guess input is 80 then The number is too high is displayed. If the user guesses the correct number i.e. 50 3rd time then the message displayed is:
It took you 3 attempts to answer.
The the user is asked to continue as:
Do you wish to continue? (Enter yes or no)
If user enters no the program exits if yes then user is asked to Guess the number again.
The screenshot of output is attached.
sa kumbensiyon naihalal si andres bonofacio bilang
Answer:
the contemporary Supremo (supreme leader) of the Katipunan
WILL MARK AS BRAINLIEST
Describe the environmental issues in India and list ways that technology has been used to address these issues.
India has been having to engineer better technology to better prepare people in india for the brutal monsoon seasons in india
Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string.
start
string name
string address
num item //use int
num quantity
num price //use double as data type
num SIZE = 6
num VALID_ITEM [SIZE] = 106, 108, 307, 405, 457, 688 //use int as data type
num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00 //use double as data type
num i
bool foundIt = false
string MSG_YES = "Item available"
string MSG_NO = "Item not found" get name, address, item, quantity
i = 0
while i < SIZE
if item == VALID_ITEM [i] then
foundIt = true
price = VALID_ITEM_PRICE [i]
endif
i = i + 1
endwhile
if foundIt == true then
print MSG_YES
print quantity, " at " , price, " each"
print "Total ", quantity * price
else
print MSG_NO
endif
stop
Answer:
Follows are the modified code in c++ language:
#include<iostream>//header file
#include<string>//header file
using namespace std;
int main()//main method
{
string name,address, MSG_YES, MSG_NO;//defining string variable
int item,quantity,size=6, i=0;//defining integer variable
double price;//defining double variable
int VALID_ITEM[]={106,108,307,405,457,688};//defining integer array and assign value
double VALID_ITEM_PRICE[]={0.59,0.99,4.50,15.99,17.50,39.00};//defining double array and assign value
bool foundIt=false;//defining bool variable
MSG_YES="Item available";//use string variable to assign value
MSG_NO = "Item not found"; //use string variable to assign value
cout<<"Input name: ";//print message
cin>>name;//input value in string variable
cout<<"Input Address: ";//print message
cin>>address;//input value in string variable
cout<<"Input Item: "<<endl;//print message
cin>>item;//input value in string variable
cout<<"Input Quantity: "<<endl;//print message
cin>>quantity;//input value in string variable
while(i <size)//defining while that checks i less then size
{
if (item ==VALID_ITEM[i]) //use if block to match item in double array
{
foundIt = true;//change bool variable value
price = VALID_ITEM_PRICE[i];//hold item price value in price variable
}
i++;//increment the value of i
}
if (foundIt == true)//use if to check bool variable value equal to true
{
cout<<MSG_YES<<endl;//print value
cout<<"Quantity "<<quantity<<" at "<<"Price "<<price<<"each"<<endl;//print value
cout<<"Total"<<quantity*price;//calculate the total value
}
else//else block
cout<<MSG_NO;//print message
}
Output:
please find the attached file.
Explanation:
In the above given C++ language modified code, four-string variable " name, address, MSG_YES, and MSG_NO", four integer variable "item, quantity, size, and i", and "integer and double" array is defined, that holds values.
In the string and integer variable "name, address, and item, quantity", we input value from the user-end and use the while loop, which uses the if block to check the "item and quantity" value from the user end and print its respective value.
Which of the following is NOT a reason to include comments in programs?
a. Comments help the computer decide whether certain components of a program
are important.
b .Comments help programmers debug issues in their own code
c. Comments help document how code was written for other programmers to use
d. Comments enable programmers to track their work throughout the development
process
Answer:
A Would be correct!
Explanation:
The reason for this is because in a code when you use the comment out the compiler will skip over it and will not do anything and will skip it. So the comment can help the computer do anything!
HOPE THIS HELPED MAKE ME THE BRAINLIST!
Using programming concepts, the option that is NOT a reason to include comments in a code is:
a. Comments help the computer decide whether certain components of a program are important.
-------------------------
Usually, codes are very long, and each person is responsible for a part of the problem. The parts have to be intervened with each other, and thus, sometimes a programmer will have to look at another part of the code, not coded by him. Thus, for the programmer and other people working in the project to understand, comments are important.Additionally, the comments are used to help the programmers debug their own code, as they can go part by part and see what is done in each part, also helping them work throughout the development process.In a program, there may be some components that end up not being necessary, but this is not decided by comments, and thus, option A is not a reason to include comments in programs.A similar problem is given at https://brainly.com/question/13527834
Which holds all of the essential memory that tells your computer how to be
a computer (on the motherboard)? *
O Primary memory
Secondary memory
PLEASE HURRY!!!
Look at the image below!
Answer:A and E
Explanation:
The last three are strings while the other choices are integers.
Putting ' ' or " " around something makes it a string and the input is asking the user to input a string.
How to get passed administrattor on macbook air to get games and stuff.
Answer:
You need to use the name and password of the main owner of the computer/the account you made when you first got it. Then, you should be able to download apps and use it if you have your apple ID set up.
Explanation:
HELP!!
Why is email etiquette important? (1 point)
Email is rarely used to communicate via technology.
With more and more written communication through technology, it is important to sound competent and qualified and for your meaning to be clear.
Not many classes are taken online.
Even though companies and employers use a lot of email communication, they don't really care if you are clear with your communication
Answer:
B
Explanation:
Read the following code:
x = 1
while(x < 26)
print(x)
x = x + 1
There is an error in the while loop. What should be fixed? (5 points)
Select one:
a. Add a colon to the end of the statement
b. Begin the statement with the keyword count
c. Change the parentheses around the test condition to quotation marks
d. Use quotation marks around the relational operator
For a while loop to function properly, it needs a colon after it.
Answer choice A is correct.
write a program that reads in a number n and prints out n rows each containing n star charactersg
In python:
rows = int(input("How many rows would you like? "))
i = 0
while i < rows:
print("*" * rows)
i += 1
I hope this helps!
What information is required for a complete citation of a website source?
A: the title, volume number, and page numbers
B: the responsible person or organization and the website URL
C: the responsible person or organization, date accessed, and URL
D: the responsible person or organization and the date accessed
Answer:
C: the responsible person or organization, date accessed, and URL
Explanation:
Cleary specifying the theme to be used for a site
before building it provides which main advantage:
site navigation
site consistency
O
a clear message
O O O
improved readability
Answer: site consistency
Answer:
B) Site Consistency
Explanation:
Which of the following industries does not use technology?
Medicine
Marketing and advertising
Law enforcement
Arts and entertainment
None of the above
Answer:
None of the above
Explanation:
Medicine uses technology to research
Advertiseres use platforms like Instagram to share the product they are promoting
Law enforcement uses tech to pull up databases of people's records
Arts and entertainment use them to create (in some cases), share, and sell their art.
Hope this helps!
Answer:
E
Explanation: got it right on edge 2020
Nowadays computer games are mostly available on external
hard disk.
Is it true or false?
Answer:
false
Explanation:
because a lot of times they are downloads without the disk
It is false that nowadays computer games are mostly available on external hard disk.
What is hard disk?A hard disk drive (HDD) is a type of computer storage device that uses magnetic storage to store and retrieve digital information.
Hard disks are usually located inside the computer and are used to store the operating system, applications, and user data such as documents, pictures, and videos.
Computer games can be stored on a variety of devices, including internal hard drives, external hard drives, solid state drives, and even cloud storage.
While external hard drives may be a popular option for some users, computer games can be installed and played from a variety of storage devices depending on user preferences and hardware capabilities.
Thus, the given statement is false.
For more details regarding hard disk, visit:
https://brainly.com/question/9480984
#SPJ2