Answer:
Explanation:
f=open("infile.txt","r")
flag=True
while(flag):
s=f.readline().strip()
if(len(s)>=4):
print(s)
else:
flag=False
Random Star
Write a method named randomStar that takes two parameters, a Random object r and an integer num. The method should keep printing lines of * characters, where each line has between 5 and 19 * characters inclusive, until it prints a line with greater than or equal to num characters. num is guaranteed to be between 5 and 19. For example, the method call randomStar(14) will print:
import java.util.*;
public class RandomStar {
public static void main(String[] args) {
Random r = new Random(2063064142); // ignore the 2063064142
randomStar(r, 12);
System.out.println();
randomStar(r, 19);
}
public static void randomStar(Random r, int num) {
}
}
Answer:
Explanation:
The following code is written in Java. The function takes in the random object and creates a random number where it generates a random number and prints out the * characters, if the random number and the input num are the same it prints out both values and ends the function.
import java.util.Random;
class Brainly {
public static void main(String[] args) {
Random r = new Random();
randomStar(r, 12);
System.out.println();
randomStar(r, 19);
}
public static void randomStar(Random r, int num) {
while (true) {
int randomNum = r.nextInt(19) + 5;
if (randomNum != num) {
for (int x = 0; x < randomNum; x++) {
System.out.print("*");
}
System.out.print("\n");
} else {
for (int x = 0; x < randomNum; x++) {
System.out.print("*");
}
System.out.print("\n");
System.out.println("Random Number: " + randomNum);
System.out.println("Input Number: " + num);
break;
}
}
}
}
New cars use embedded computers to make driving safer
Answer:
true.......................
New cars use embedded computers to make driving safer. The given statement is true.
What is RAM?
The word RAM stands for random-access memory and it is known as memory of short term where data is stored and as required by the processor. This is not there to deal with long term data and it is working after the computer turned off.
Generally, there are three types of RAM and these are SRAM, ECC, and DRAM. The SRAM stands for static random memory, and DRAM stands for dynamic access memory.
CPU stands for central processing unit and commonly it is known as brain of the computer, the main function of CPU is to control the function of the computer or system and it gives command to the parts of computer.
Therefore, New cars use embedded computers to make driving safer. The given statement is true.
Learn more about RAM and CPU here:
brainly.com/question/21252547
#SPJ2
Understanding Join Types
Which join type will only include rows where the joined fields from both tables are equal?
O inner join
O left outer join
Oright inner join
O right outer join
Answer: inner join
Explanation:Edg. 2021
What is the problem with paying only your minimum credit card balance each month?
A. It lowers your credit score
B. You have to pay interest
C. The bank will cancel your credit card
D. All of the above
Answer:b
Explanation:
Answer: The answer is B.
Explanation: While yes it is important to make at least the minimum payment, its not ideal to carry a balance from month to month (You'll rack up interest charges). And risk falling into debt. Therefore, the answer is B.
Hope this helps!
Can anybody please help me with 7.4.7 spelling bee codehs?
Answer:
word = "eggplant"
print "Your word is: " + word + "."
for i in word:
print i + "!"
Explanation:
i don't know why but it is
Answer:
word = "eggplant"
print("Your word is !" + word + "!")
for i in word:
INDENT HERE or TAB print( i + "!")
Explanation:
Add an indentation right before the print( i + "!")
You have a larger file but do not need it right away. In this scenario, you have to change the way a file is used to make it what?
O open
o closed
compressed
O usable
Answer:
Compressed
Explanation:
I hope this helps!
Answer:
usable
Explanation:
open doesnt make any sense, neither does closed and compressed is wrong i chose it and got it wrong. Its usable
PLEASE HELP ME ASAP
Write a program that replaces words in a sentence. The input begins with an integer indicating the number of word replacement pairs (original and replacement) that follow. The next line of input begins with an integer indicating the number of words in the sentence that follows. Any word on the original list is replaced. Assume that the list will always contain less than 20 word replacement pairs. Ex: If the input is:
Answer:
try this
Explanation:
if name == '__main__':
words = input().split()
data = input()
for i in range(0, len(words), 2):
if words[i] in data:
data = data.replace(words[i], words[i + 1])
print(data)
Plz hurry it’s timed
For this assignment your are to implement the Pet Class described in Programming Exercise 1, starting on page 494 in our textbook. Additionally your program will allow users to enter the pet's information until the user enters in the string "quit". Once the user enters quit the program will print out a summary of all the information that has been entered. Your program should not assume any maximum number of pets that can be added. Items in blue designate output. Items in red designate computer input. Example Test Case: Enter name, type and age of your pet: Name: Momo Type: Bird Age: 33 Enter "quit" to stop entering. Anything else to continue. a Enter name, type and age of your pet: Name: Pooh Type: Dog Age: 8 Enter "quit" to stop entering. Anything else to continue. quit SUMMARY: Name: Momo, Type: Bird, Age: 33. Name: Pooh, Type: Dog, Age: 8.
Answer:
ohhhvhhffifyuddfuiicfdguc
Create a program which reads in CSV data of Creatures and loads them into aHash Map. The key of this hash map will be the name of each creature. For your hash function, you can simply use the sum of all ASCII values. You can also come up with your own hash function. Your program should present a menu to the user allowing them to look up a creature by name. Additionally, create a function that allows the user to insert a new creature. This creature should be added to the existing hash map. If the name entered by the user already exists, DO NOT ADD IT TO THE HASH MAP. Simply report that the creature already exists. If the creature is unique and successfully added, report the calculated index value. Your hash array should start as size4. You will need to implement a rehashing function to maintain a load factor of 0.75. Collision resolution should be handled via separate chaining with linked lists.
Other Requirements
•Read in a CSV file from the command line when running the program.
•Convert the raw CSV data into the creature struct and add it to a HashMap
•Make sure you properly release all of your allocated memory.
•Format your code consistently.
•Function declarations, structs, and preprocess directives should be placed in a corresponding header file.
•Save your code for this problem ascreature_hash.(c|h).
Creature struct
typedef struct {
char *name;
char *type;
int hp;
int ac;
int speed;
} Creature;
Example Run
1. Search
2. Add Creature
3. Exit
> 1
Enter name: Terrasque
Unable to find "Terrasque"
1. Search
2. Add Creature
3. Exit
> 2
Enter name: Storm Giant
Enter type: Huge giant
Enter HP: 230
Enter AC: 16
Enter speed: 50
Storm Giant added at index 3.
CSV file: Name, hp, ac, speed, type
Rakshasa,110,16,40,Fiend
Priest,27,13,25,Humanoid
Berserker,67,13,30,Humanoid
Fire Elemental,102,13,50,Elemental
Kraken,472,18,20,Monstrosity
Centaur,45,12,50,Monstrosity
Mage,40,12,30,Humanoid
Hell Hound,45,15,50,Fiend
Basilisk,52,15,20,Elemental
Androsphinx,199,17,40,Monstrosity
Efreeti,200,17,40,Elemental
Balor,262,19,40,Fiend
Chain Devil,142,19,40,Fiend
Adult Black Dragon,195,19,80,Dragon
Adult Blue Dragon,225,19,80,Dragon
Adult Red Dragon,256,19,80,Dragon
Please help in C
Answer:
Explanation:
class TableInput{
Object key;
Object value;
TableInput(Object key, Object value){
this.key = key;
this.value = value;
}
}
abstract class HashTable {
protected TableInput[] tableInput;
protected int size;
HashTable (int size) {
this.size = size;
tableInput = new TableInput[size];
for (int i = 0; i <= size - 1; i++){
tableInput[i] = null;
}
}
abstract int hash(Object key);
public abstract void insert(Object key, Object value);
public abstract Object retrieve(Object key);
}
class ChainedTableInput extends TableInput {
ChainedTableInput(Object key, Object value){
super(key, value);
this.next = null;
}
ChainedTableInput next;
}
class ChainedHashTable extends HashTable {
ChainedHashTable(int size) {
super(size);
// TODO Auto-generated constructor stub
}
public int hash(Object key){
return key.hashCode() % size;
}
public Object retrieve(Object key){
ChainedTableInput p;
p = (ChainedTableInput) tableInput[hash(key)];
while(p != null && !p.key.equals(key)){
p = p.next;
}
if (p != null){
return p.value;
}
else {
return null;
}
}
public void insert(Object key, Object value){
ChainedTableInput entry = new ChainedTableInput(key, value);
int k = hash(key);
ChainedTableInput p = (ChainedTableInput) tableInput[k];
if (p == null){
tableInput[k] = entry;
return;
}
while(!p.key.equals(key) && p.next != null){
p = p.next;
}
if (!p.key.equals(key)){
p.next = entry;
}
}
public double distance(Object key1, Object key2){
final int R = 6373;
Double lat1 = Double.parseDouble(Object);
}
}
Which principle of layout design is shown below
Consolidated Supplies is a medium-sized distributor of restaurant supplies that operates in Canada and several northern U.S. states. They have 12 large warehouses spread across both countries to service their many customers. Products arrive from the manufacturers and are stored in the warehouses until they are picked and put on a truck for delivery to their customers. The networking equipment in their warehouses is old and is starting to give them problems; these problems are expected to increase as the equipment gets older. The vice president of operations, Pat McDonald, would like to replace the existing LANs and add some new wireless LAN technology into all the warehouses, but he is concerned that now may not be the right time to replace the equipment. He has read several technology forecasts that suggest there will be dramatic improvements in networking speeds over the next few years, especially in wireless technologies. He has asked you for advice about upgrading the equipment.
Should Consolidated Supplies replace all the networking equipment in all the warehouses now, should it wait until newer networking technologies are available, or should it upgrade some of the warehouses this year, some next year, and some the year after, so that some warehouses will benefit from the expected future improvements in networking technologies?
Answer:
Consolidated Supplies
Consolidated Supplies should upgrade some of the warehouses this year, some next year, and others the year after, so that some warehouses will benefit from the expected future improvements in networking technologies.
Explanation:
Gradual technology upgrade should be the way forward for Consolidated Supplies. Waiting until newer networking technologies are available is not an option. Total replacement of all the networking equipment in all the warehouses is not an option, as technology equipment becomes obsolete in no time. Overall, Consolidated Supplies should never forget the numerous benefits from technology upgrade, including reduction of downtime, increased productivity, and improved customer services and satisfaction.
What characteristics should be determined to design a relational database? Check all that apply.
the fields needed
the tables needed
the keys and relationships
the purpose of the database
all of the tables in the database
all of the records in the database
the queries, forms, and reports to generate
Answer: 1,2,3,4,7
Just took it (:
What is the purpose of exploring data?
a.
To generate labels for your data.
b.
To gain a better understanding of your data.
c.
To gather your data into one repository.
d.
To digitize your data.
Answer:
b. To gain a better understanding of your data.
Explanation:
A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.
A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.
In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.
This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.
Data exploration (mining) can be defined as a process which typically involves extracting and analyzing data contained in large databases through the use of specialized software to generate new information.
The main purpose of data exploration is to gain a better understanding of your data and get to insights faster. Thus, data exploration helps to cut down a large data set into a manageable size through the use of statistical or data visualization tools, thereby, gaining a better understanding of the nature of the data.
Answer:
b. To gain a better understanding of your data.
Explanation:
explore and visualize data to uncover insights from the start or identify areas or patterns to dig into more.
How I did it. Part 4
Answer:
What are you asking for in this problem?
Explanation:
Write an interface called Shape, inside, there is a method double area(); write a class called Box which implements the Shape. In Box, there are two data members: a double called length, and a double called width. Also implements constructor, and the method area() which calculates the area by multiplying the length and width. Then write a Tester class, which has a main method and creates a box object and displays the area.
Answer:
Explanation:
The following code is written in Java. It contains the interface Shape, the class Box, and a tester class called Brainly with the main method. Box implements the Shape interface and contains, the instance variables, the constructor which takes in the inputs for length and width, getter methods for length and width, and the defines the area() method from the interface. Then the object is created within the Brainly tester class' main method and the area() method is called on that object. Output can be seen in the image attached below. Due to technical difficulties, I have added the code as a txt file below.
What are 3 data Gathering method that you find effective in creating interactive design for product interface and justify your answer?
Answer:
In other words, you conducted the four fundamental activities that make up the interaction design process – establishing requirements, designing alternatives, prototyping designs, and evaluating prototypes.
Explanation:
Complete the statement below using the correct term.
One recurring problem in networking is finding that users have used a hub or a switch to circumvent a
________
Answer:
HURRY
Dr. Khan works for the marketing department of a company that manufactures mechanical toy dogs. Dr. Khan has been asked to assess the effectiveness of a new advertising campaign that is designed to be most persuasive to people with a certain personality profile. She brought four groups of participants to the lab to watch the video advertisements and to measure the likelihood that they would purchase the toy, both before and after watching the ad. The results of Dr. Khan’s study are presented below.
Part A
Explain how each of the following concepts applies to Dr. Khan’s research.
Survey
Dependent variable
Big Five theory of personality
Part B
Explain the limitations of Dr. Khan’s study based on the research method used.
Explain what Dr. Khan’s research hypothesis most likely was.
Part C
Use the graph to answer the following questions.
How did the trait of agreeableness affect how people responded to the new ad campaign?
How did the trait of conscientiousness affect how people responded to the new ad campaign?
Working with do-while loop
Bring the program dowhile.cpp from the Lab 5 folder.
The code is shown below:
______________________________________________________________________________
// This program displays a hot beverage menu and prompts the user to
// make a selection. A switch statement determines which item the user
// has chosen. A do-while loop repeats until the user selects item E
// from the menu.
// PLACE YOUR NAME HERE
#include
#include
using namespace std;
int main()
{
// Fill in the code to define an integer variable called number,
// a floating point variable called cost,
// and a character variable called beverage
bool validBeverage;
cout << fixed << showpoint << setprecision(2);
do
{
cout << endl << endl;
cout << "Hot Beverage Menu" << endl << endl;
cout << "A: Coffee $1.00" << endl;
cout << "B: Tea $ .75" << endl;
cout << "C: Hot Chocolate $1.25" << endl;
cout << "D: Cappuccino $2.50" << endl <
cout << "Enter the beverage A,B,C, or D you desire" << endl;
cout << "Enter E to exit the program" << endl << endl;
// Fill in the code to read in beverage
switch(beverage)
{
case 'a':
case 'A':
case 'b':
case 'B':
case 'c':
case 'C':
case 'd':
case 'D': validBeverage = true;
break;
default: validBeverage = false;
}
if (validBeverage == true)
{
cout << "How many cups would you like?" << endl;
// Fill in the code to read in number
}
// Fill in the code to begin a switch statement
// that is controlled by beverage
{
case 'a':
case 'A': cost = number * 1.0;
cout << "The total cost is $ " << cost << endl;
break;
// Fill in the code to give the case for tea ( $0.75 a cup)
//Fill in the code to give the case for hot chocolate($1.25 a cup)
// Fill in the code to give the case for cappuccino ($2.50 a cup)
case 'e':
case 'E': cout << " Please come again" << endl;
break;
default:cout << // Fill in the code to write a message
// indicating an invalid selection.
cout << " Try again please" << endl;
}
} // Fill in the code to finish the do-while statement with the
// condition that beverage does not equal (E or e).
// Fill in the appropriate return statement
}
Answer:
it throws an error with the includes.
and some undeclared variables.
Explanation:
please fix that.
Describing How to Create a Self-Join Query
Use the drop-down menus to complete the steps for creating a self-join query.
1. Click the
tab.
2. In the Queries group, click Query Design.
3. In the Show Table dialog box, add
4. Click and drag a field from one copy of the table and drop it on the other table.
5. Add the fields to the query.
6. Click
to see the results.
е
Answer:1. Click the ✔ Create tab.
2. In the Queries group, click Query Design.
3. In the Show Table dialog box, add ✔ the same table twice
.
4. Click and drag a field from one copy of the table and drop it on the other table.
5. Add the fields to the query.
6. Click ✔ Run
to see the results.
Explanation:on edg
Describing How to Create a Self-Join Query Use the drop-down menus to complete the steps for creating a self-join query is by 1. Click the tick in the tab to design a Self-Join Query.
Why can we use self be a part of?A self-be a part of is a be a part of that may be used to sign up for a desk with itself. Hence, it's miles a unary relation. In a self-be, a part of, every row of the desk is joined with itself and all of the different rows of the equal desk.
The Query and View Designer assigns an alias to the second one example via way of means of including a sequential wide variety to the desk name. In addition, the Query and View Designer creates a be a part of line among the 2 occurrences of the desk or desk-valued item withinside the Diagram pane.
Read more about the Queries :
https://brainly.com/question/25694408
#SPJ2
Write an algorithm and flowchart to display H.C.F and L.C.M of given to numbers.
Answer:
Write an algorithm to input a natural number, n, and calculate the odd numbers equal or less than n. ... Design an algorithm and flowchart to input fifty numbers and calculate their sum. Algorithm: Step1: Start Step2: Initialize the count variable to zero Step3: Initialize the sum variable to zero Step4: Read a number say x Step 5: Add 1 to the number in the count variable Step6: Add the ..
Explanation:
4. Why do animals move from one place to another?
Answer:
Animal move from one place to another in search of food and protect themselves from their enemies.They also move to escape from the harsh climate. Animal move from one place to another in search of food,water and shelter.
Answer:
Animals move one place to another because he search food and shelter
Please help me ASAP!
Answer:
security hacker
Explanation:
security hackers are people who hack software to check for vulnerabilities. most of the time security hackers are white hat hackers who work to perform penetration tests to see if a software is secure.
tell me if this is wrong :)
Describing How to Insert a Subdatasheet
Use the drop-down menus to complete the steps for inserting a subdatasheet.
1. Open a table in Design view.
2. Click the
v tab, and in the Records group, click
3. In the drop-down menu, select Subdatasheet.
4. In the Insert Subdatasheet dialog box, select the table you want and click
5. If there is no relationship between the tables, you can
one.
Ve
Answer:
1. Home
2. More
4. Ok
5. Create
Explanation:
Answer:
1. insert
2. smartart
3. OK
4. close
Explanation:
Python The Sieve of Eratosthnes Prgram
A prime integer is any integer greater than 1 that is evenly divisible only by itself and 1. The Sieve of Eratosthenes is a method of finding prime numbers. It operates as follows:
Create a list with all elements initialized to 1 (true). List elements with prime indexes will remain 1. All other elements will eventually be set to zero.
Starting with list element 2, every time a list element is found whose value is 1, loop through the remainder of the list and set to zero every element whose index is a multiple of the index for the element with value 1. For list index 2, all elements beyond 2 in the list that are multiples of 2 will be set to zero (indexes 4, 6, 8, 10, etc.); for list index 3, all elements beyond 3 in the list that are multiples of 3 will be set to zero (indexes 6, 9, 12, 15, etc.); and so on.
When this process is complete, the list elements that are still set to 1 indicate that the index is a prime number. These indexes can then be printed. Write a program that uses a list of 1000 elements to determine and print the prime numbers between 2 and 999. Ignore element 0 of the list. The prime numbers must be printed out 10 numbers per line.
Sample Executions:
Prime numbers between 2 and 999 as determined by the Sieve of Eratosthenes.
2 357 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71
73 79 83 89 97 101 103 107 109 113
127 131 137 139 149 151 157 163 167 173
179 181 191 193 197 199 211 223 227 229
233 239 241 251 257 263 269 271 277 281
283 293 307 311 313 317 331 337 347 349
353 359 367 373 379 383 389 397 401 409
419 421 431 433 439 443 449 457 461 463
467 479 487 491 499 503 509 521 523 541
547 557 563 569 571 577 587 593 599 601
607 613 617 619 631 641 643 647 653 659
661 673 677 683 691 701 709 719 727 733
739 743 751 757 761 769 773 787 797 809
811 821 823 827 829 839 853 857 859 863
877 881 883 887 907 911 919 929 937 941
947 953 967 971 977 983 991 997
Answer:
try this
Explanation:
def SieveOfEratosthenes(n):
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p +=1
c=0
for p in range(2, n):
if prime[p]:
print(p," ",end=" ")
c=c+1
if(c==10):
print("")
c=0
n= 1000
print("prime number between 2 to 999 as determined by seive of eratostenee ")
SieveOfEratosthenes(n)
Which of the following is NOT an example of a metasearch engine?
Answer:
Where is the choices mate?
What is up with the bots? They are so annoying.
Answer:
very very very annoying
Answer:
yeah
Explanation:
Find the sum of the values from one to ten using recursion
Answer:
see picture
Explanation:
The result is 55, which can also be verified using the formula:
(n)(n-1)/2 => 10*9/2 = 55
A security technician is configuring a new firewall appliance for a production environment. The firewall must support secure web services for client workstations on the 10.10.10.0/24 network. The same client workstations are configured to contact a server at 192.168.1.15/24 for domain name resolution.
Required:
What rules should the technician add to the firewall to allow this connectivity for the client workstations
Answer:
Explanation:
Based on the information provided in the question, the best rules that the technician should add to the firewall would be the following
Permit 10.10.10.0/24 0.0.0.0 -p tcp --dport 443
Permit 10.10.10.0/24 192.168.1.15/24 -p udp --dport 53
This is because port 443 is used for "Secure webs services" while UDP port 53 is used for queries and domain name resolution. Both of which are the main configurations that the security technician needs to obtain.