Define a function createPhonebook that accepts three arguments: A list of first names A list of last names A list of phone numbers All three arguments will have the same number of items. createPhonebook should return a dictionary where the keys are full names (first name then last name) and the values are phone numbers. For example: firstNames
Answer:
def createPhonebook(firsts, lasts, numbers):
d = {}
for i in range(len(firsts)):
k = firsts[i] + " " + lasts[i]
d[k] = numbers[i]
return d
Explanation:
Create a function named createPhonebook that takes three arguments, firsts, lasts, numbers
Initialize an empty dictionary, d
Create a for loop that iterates the length of the firsts times(Since all the arguments have same length, you may use any of them). Inside the loop, set the key as the item from firsts, a space, and item from lasts (If the name is "Ted" and last name is "Mosby", then the key will be "Ted Mosby"). Set the value of the key as the corresponding item in the numbers list.
When the loop is done, return the d
How could these same commands be used on a computer or network operating system?
Answer:
To manipulate data into information
What is the output, if userVal is 5? int x; x = 100; if (userVal != 0) { int tmpVal; tmpVal = x / userVal; System.out.print(tmpVal); }
Answer:
The output is 20
Explanation:
This line divides the value of x by userVal
tmpVal = x / userVal;
i.e.
tmpVal = 100/5
tmpVal = 20
This line then prints the value of tmpVal
System.out.print(tmpVal);
i.e 20
Hence, The output is 20
How is actual cost calculated?
Please answer
Answer:
One method of calculating product costs for a business is called the actual costs/actual output method. Using this technique, you take your actual costs — which may have been higher or lower than the budgeted costs for the year — and divide by the actual output for the year.
Explanation:
After a chart has been inserted and formatted, is it possible to change the data range it refers to or to add new rows of data?
A:No, additional data cannot be included in a chart once it has been created; the user should delete the chart and create a new chart.
B:Yes, click the Select Data button in the Data group under the Design tab to extend or reduce the data range.
C:Yes, click the chart, select the additional rows or columns of data to add, and press Enter on the keyboard.
D:Yes, double-click the chart and select Properties from the list; in the Properties box, insert the new data range to include in the chart.
Answer:
b) Yes, click on the Select Data button in the Data group under the Design tab to extend or reduce the data range.
Explanation:
The correct answer is b. Data ranges included in a chart frequently need to change to include more rows or columns. Extend or reduce the range quickly by using the Select Data Source dialogue box to revise the data range. :)
Answer:
ITS B
Explanation:
edge2021
Which situation best illustrates how traditional economies meet their citizens needs for employment and income
APEX!!
A. A parent teaches a child to farm using centuries old techniques.
B. A religious organization selects a young person to become a priest
C. A government agency assigns a laborer a job working in a factory
D. A corporation hires an engineer who has just graduated from college
The situation that best show how traditional economies meet their citizens needs for employment and income is that a parent teaches a child to farm using centuries old techniques.
What is a traditional economy about?A traditional economy is known to be a type of system that depends on customs, history, and time framed/honored beliefs.
Tradition is know to be the guide that help in economic decisions such as production and distribution. Regions with traditional economies are known to depend on agriculture, fishing, hunting, etc.
Learn more about traditional economies from
https://brainly.com/question/620306
This assignment requires you to write a program to analyze a web page HTML file. Your program will read one character at a time from the file specifying the web page, count various attributes in the code for the page, and print a report to the console window giving information about the coding of the page.
Note that a search engine like Google uses at least one technique along similar lines. To calculate how popular (frequently visited or cited) a web page is, one technique is to look at as many other worldwide web pages as possible which are relevant, and count how many links the world's web pages contain back to the target page.
Learning Objectives
To utilize looping structures for the first time in a C++ program
To develop more sophisticated control structures using a combination of selection and looping
To read data from an input file
To gain more experience using manipulators to format output in C++
To consider examples of very simple hypertext markup language (HTML)
Use UNIX commands to obtain the text data files and be able to read from them
Problem Statement
Your program will analyze a few things about the way in which a web page is encoded. The program will ask the user for the name of a file containing a web page description. This input file must be stored in the correct folder with your program files, as discussed in class, and it must be encoded using hypertext markup language, or HTML. The analysis requires that you find the values of the following items for the page:
number of lines (every line ends with the EOLN marker; there will be an EOLN in front of the EOF)
number of tags (includes links and comments)
number of links
number of comments in the file
number of characters in the file (note that blanks and EOLNs do count)
number of characters inside tags
percentage of characters which occur inside tags, out of the total
Here is an example of a very simple HTML file:
Course Web Page
This course is about programming in C++.
Click here
You may assume that the HTML files you must analyze use a very limited subset of basic HTML, which includes only the following "special" items:
tag always starts with '<' and ends with >
link always starts with "
comment always starts with ""
You may assume that a less-than symbol (<) ALWAYS indicates the start of a tag. A tag in HTML denotes an item that is not displayed on the web page, and often gives instructions to the web browser. For example, indicates that the next item is the overall title of the document, and indicates the end of that section. In tags, both upper and lowercase letters can be used.
Note on links and comments: to identify a link, you may just look for an 'a' or 'A' which occurs just after a '<'. To identify a comment, you may just look for a '!' which follows just after a '' (that is, you do not have to check for the two hyphens).
You may assume that these are the only HTML language elements you need to recognize, and that the HTML files you process contain absolutely no HTML syntax errors.
Note: it is both good style because readability is increased, and convenient, to declare named constants for characters that are meaningful, for example
const char TAG OPEN = '
Sample Input Files
Program input is to be read from a text file. Your program must ask the user for interactive input of the file name. You can declare a variable to store the file name and read the user's response
Miscellaneous Tips and Information
You should not read the file more than once to perform the analysis. Reading the file more than once is very inefficient.
The simplest, most reliable and consistent way to check for an end of file condition on a loop is by checking for the fail state, as shown in lectures. The eof function is not as reliable or consistent and is simply deemed "flaky" by many programmers as it can behave inconsistently for different input files and on different platforms.
You may use only while loops on this project if you wish; you are not required to choose amongst while, do while and/or for loops until project 4 and all projects thereafter. Do not create any functions other than main() for this program. Do not use data structures such as arrays. You may only have ONE return statement and NO exit statements in your code. You may only use break statements inside a switch statement in the manner demonstrated in class; do not use break or continue statements inside loops.
#include // used for interactive console I/O
#include // used to format output
#include // used to retrieve data from file
#include // used to convert data to uppercase to simplify comparisons
#include 11 for string class functions
int main() { 1
//constants for analysing HTML attributes
const char EOLN = '\n';
const char COMMENT_MARK = '!';
const char LINK='A';
//constants to format the output
const int PAGEWIDTH = 70;
const char UNDERLINE = '=';
const char SPACE =
const int PCT_WIDTH = 5;
const int PCT_PRECISION = 2;
Answer:
bro it is a question what is this
Explanation:
please follow me
Plz help ASAP
Where are fiber optic cables often used?
A. To connect LANs inside your home
B. To support wireless access points (WAP)
C. To enable near field communications
D. To connect networks that are far apart of that have high data volumes.
Answer:
D
Explanation:
fiber optic cables are generally used by isps which is why they call their internet fiber optic
Tasha works as an information technologist for a company that has offices in New York, London, and Paris. She is based out of the New York office and uses the web to contact the London and Paris office. Her boss typically wants her to interact with customers and to run training seminars to teach employees new software and processes. Which career pathway would have this type of employee?
Answer:
D. Interactive Media
Explanation:
i just took the test right now
The career pathway which would have this type of employee is an interactive media.
What is media?Media is a terminology that is used to describe an institution that is established and saddled with the responsibility of serving as a source for credible, factual and reliable news information to its audience within a geographical location, either through an online or print medium.
In this context, an interactive media is a form of media that avail all media personnels an ability to easily and effectively interact with their customers or audience.
Read more on media here: https://brainly.com/question/16606168
To prevent any unnecessary injuries to small adults and the elderly from a deploying airbag, these
individuals should
as possible.
A. position their seats as far forward
B. position their seats as far back
c. recline their seats as far back
D. none of the above
Answer:
B. position their seats as far back
Explanation:
An airbag can be defined as a vehicle safety device (bag) that is designed to be inflated and eventually deflated in an extremely rapid or quick manner during an accident or collision.
Basically, an airbag refers to an occupant-restraint safety device installed on vehicles to protect both the driver and front-seat passenger in the event of an accident or collision. An airbag typically comprises of an impact sensor, flexible fabric bag, airbag cushion and an inflation module.
In order to prevent any unnecessary injuries to small adults and the elderly from a deploying airbag, these individuals should position their seats as far back as possible. This ultimately implies that, both the driver and the front-seat passenger are advised not to position too close to the dashboard; the seats should be as far back as possible.
The collaborative team responsible for creating a film is in the process of creating advertisements for it and of figuring out how to generate excitement about the film. Which of the five phases of filmmaking are they most likely in?
Answer:
Distribution.
Explanation:
Filmmaking can be defined as the art or process of directing and producing a movie for viewing in cinemas or television. The process of making a movie comprises of five (5) distinct phases and these are;
1. Development.
2. Pre-production.
3. Production.
4. Post-production.
5. Distribution.
Distribution refers to the last phase of filmmaking and it is the stage where the collaborative team considers a return on investment by creating advertisements in order to have a wider outreach or audience.
In this scenario, the collaborative team responsible for creating a film is in the process of creating advertisements for it and of figuring out how to generate excitement about the film.
Hence, they are likely to be in the distribution phase in relation to the five phases of filmmaking.
Answer:
C: distribution
Explanation:
edg2021
Write two statements to read in values for my_city followed by my_state. Do not provide a prompt. Assign log_entry with current_time, my_city, and my_state. Values should be separated by a space. Sample output for given program if my_city is Houston and my_state is Texas: 2014-07-26 02:12:18: Houston Texas Note: Do not write a prompt for the input values. 1 current_time = '2014-07-26 02:12:18:' 2 my_city = "' 3 my_state = "" 4 log_entry - "' 1 test passed 6 print(log_entry) All tests passed Run Run
Answer:
Here is the program:
current_time = '2014-07-26 02:12:18:'
my_city = ''
my_state = ''
log_entry = ''
my_city = input("") #reads in value for my_city
my_state = input("") #reads in value for my_state
log_entry = current_time + ' ' + my_city + ' ' + my_state #concatenates current_time, my_city and my_state values with ' ' empty space between them
print(log_entry)
Explanation:
You can also replace
log_entry = current_time + ' ' + my_city + ' ' + my_state
with
log_entry = f'{current_time} {my_city} {my_state}'
it uses f-strings to format the strings
If you want to hard code the values for my_city and my_state then you can replace the above
my_city = input("")
my_state = input("")
with
my_city = "Houston"
my_state = "Texas"
but if you want to read these values at the console from user then use the input() method.
The screenshot of the program along with the output is attached.
In this exercise we have to use the knowledge of the python language to write the code, so we have to:
The code is in the attached photo.
So to make it easier the code can be found at:
current_time = '2014-07-26 02:12:18:'
my_city = ''
my_state = ''
log_entry = ''
my_city = input("") #reads in value for my_city
my_state = input("") #reads in value for my_state
log_entry = current_time + ' ' + my_city + ' ' + my_state #concatenates current_time, my_city and my_state values with ' ' empty space between themlog_entry = current_time + ' ' + my_city + ' ' + my_state
log_entry = f'{current_time} {my_city} {my_state}'
my_city = input("")
my_state = input("")
my_city = "Houston"
my_state = "Texas"
See more about python at brainly.com/question/26104476
the company has finished designing a software program but users aren't sure how to use it
Answer:
The company should go back into the company and make it a little more easier to use or the company should put out an announcement or something so the people trying to use it know how
Explanation:
Mark me the brainliest please and rate me
Answer:
Several people in the human resources department need new software installed. An employee has an idea for a software program that can save the company time, but doesn't know how to write it.
Explanation:
Which transition level is designed to begin the process of public participation?
A. Level 1: Monitor
B. Level 2: Command
C. Level 3: Coordinate
D. Level 4: Cooperate
E. Level 5: Collaborate
Question 8 (3 points) Which of the following is an external factor that affects the price of a product? Choose the answer.
sales salaries
marketing strategy
competition
production cost
Answer: tax
Explanation: could effect the cost of items because the tax makes the price higher
oh sorry i did not see the whole question
this is the wrong awnser
which of the following uses technical and artistic skills to create visual products that communicate information to an audience? ○computer engineer ○typography ○computer animator ○graphic designer
Answer:
grafic desiner
Explanation:
just a guess lol
Answer:
I don't know...
Explanation:
D
Write a program that computes and display the n! for any n in the range1...100
Answer:
const BigNumber = require('bignumber.js');
var f = new BigNumber("1");
for (let i=1; i <= 100; i++) {
f = f.times(i);
console.log(`${i}! = ${f.toFixed()}`);
}
Explanation:
Above is a solution in javascript. You will need a bignumber library to display the numbers in full precision.
Explain why it is not necessary for a program to be completely free of defects before it is delivered to its customers?
Answer:
Testing is done to show that a program is capable of performing all of its functions and also it is done to detect defects.
It is not always possible to deliver a 100 percent defect free program
A program should not be completely free of all defects before they are delivered if:
1. The remaining defects are not really something that can be taken as serious that may cause the system to be corrupt
2. The remaining defects are recoverable and there is an available recovery function that would bring about minimum disruption when in use.
3. The benefits to the customer are more than the issues that may come up as a result of the remaining defects in the system.
Consider the two lists A and B. List A is an anagram of list B if the following two conditions are true: 1.list A and list B have the same number of elements 2.each element of list A occurs the same number of times in list A and list BFor example, [3, 2, 4, 1, 2] and [2, 2, 3, 1, 4] are anagram of each other, but [2, 3, 1, 2] and [1, 3, 1, 2] are not. Write a function named isAnagram that takes two lists of integers as parameters: lstA and lstB. The function isAnagram should return the bool value True if lstA is an anagram of lstB and False otherwise. The following is an example of correct output: >>> print(isAnagram([14, 10, 19], [10, 14, 19]))True
Answer:
cdacaddacdbbbbbacddebb
Explanation:
Choose the word to make the sentence true. The ____ function is used to display the program's output.
O input
O output
O display
The output function is used to display the program's output.
Explanation:
As far as I know this must be the answer. As tge output devices such as Monitor and Speaker displays the output processed.
The display function is used to display the program's output. The correct option is C.
What is display function?Display Function Usage displays a list of function identifiers. It can also be used to display detailed usage information about a specific function, such as a list of user profiles with the function's specific usage information.
The displayed values include the prefix, measuring unit, and required decimal places.
Push buttons can be used to select functions such as summation, minimum and maximum value output, and tare. A variety of user inputs are available.
A display is a device that displays visual information. The primary goal of any display technology is to make information sharing easier. The display function is used to display the output of the program.
Thus, the correct option is C.
For more details regarding display function, visit:
https://brainly.com/question/29216888
#SPJ5
Which error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d. human e. None of the above
Answer:
Logic Error
Explanation:
I'll answer the question with the following code segment.
Program to print the smallest of two integers (written in Python)
num1 = int(input("Num 1: "))
num2 = int(input("Num 2: "))
if num1 < num2:
print(num2)
else:
print(num1)
The above program contains logic error and instead will display the largest of the two integers
The correct logic is
if num1 < num2:
print(num1)
else:
print(num2)
However, the program will run successfully without errors
Such errors are called logic errors
20 POINTS!!!!!!! Which is considered a collection of code that can be run?
a computer program is a collection of instructions that can be executed by a computer to perform a specific task. A computer program is usually written by a computer programmer in a programming language.
Answer:
PROGRAM
Explanation:
I went and looked it up in my lesson, and I got it correct!!
Hope This Helped! :)
Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from minimum up to that maximum, inclusive, boxed by curly brackets. For example, consider the following method calls:
Answer:
The method in python is as follows:
class myClass:
def printRange(min,max):
for i in range(min, max+1):
print("{"+str(i)+"} ", end = '')
Explanation:
This line declares the class
class myClass:
This line defines the method
def printRange(min,max):
This line iterates from min to max
for i in range(min, max+1):
This line prints the output in its required format
print("{"+str(i)+"} ", end = '')
Documents files should be saved as a _____ file
Answer:
Explanation:
Windows 1.0 was not considered to be a "true" operating system but rather an operating environment because _____.
it provided a shell for MS-DOS
it could only run one application at a time
it didn't use a pointing device
it crashed a lot
Answer:
Because it was only a shell; MS-DOS was still the operating system.
Explanation:
i took the quiz it ia accurate
Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which principal of programing should Alice review?
Answer:
sequencing
Explanation:
from flvs
Answer:
Sequencing
Explanation:
1.00 Point: WD Skill 1.9 Create Document Footers
Add the Title field using the default format to the footer of the document.
Answer: 1.00 point
Explanation:
Using the drop-down menus, correctly complete the sentences.
A(n)_____
is a set of step-by-step instructions that tell a computer exactly what to do.
The first step in creating a computer program is defining a(n)_____
the next step is creating a(n)______
problem that can be solved by a computer program.
A person writing a computer program is called a(n)
DONE
Answer:
I'm pretty sure these are right:
1. algorithm
2. problem
3. math
4. computer programmer
In this exercise you will debug the code which has been provided in the starter file. The code is intended to take two strings, s1 and s2 followed by a whole number, n, as inputs from the user, then print a string made up of the first n letters of s1 and the last n letters of s2. Your job is to fix the errors in the code so it performs as expected (see the sample run for an example).
Sample run
Enter first string
sausage
Enter second string
races
Enter number of letters from each word
3
sauces
Note: you are not expected to make your code work when n is bigger than the length of either string.
1 import java.util.Scanner;
2
3 public class 02_14_Activity_one {
4 public static void main(String[] args) {
5
6 Scanner scan = Scanner(System.in);
7
8 //Get first string
9 System.out.println("Enter first string");
10 String s1 = nextLine(); 1
11
12 //Get second string
13 System.out.println("Enter second string");
14 String s2 = Scanner.nextLine();
15
16 //Get number of letters to use from each string
17 System.out.println("Enter number of letters from each word");
18 String n = scan.nextLine();
19
20 //Print start of first string and end of second string
21 System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));
22
23
24 }
Answer:
Here is the corrected program:
import java.util.Scanner; //to accept input from user
public class 02_14_Activity_one { //class name
public static void main(String[] args) { //start of main method
Scanner scan = new Scanner(System.in); //creates Scanner class object
System.out.println("Enter first string"); //prompts user to enter first string
String s1 = scan.nextLine(); //reads input string from user
System.out.println("Enter second string"); //prompts user to enter second string
String s2 = scan.nextLine(); //reads second input string from user
System.out.println("Enter number of letters from each word"); //enter n
int n = scan.nextInt(); //reads value of integer n from user
System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));
} } //uses substring method to print a string made up of the first n letters of s1 and the last n letters of s2.
Explanation:
The errors were:
1.
Scanner scan = Scanner(System.in);
Here new keyword is missing to create object scan of Scanner class.
Corrected statement:
Scanner scan = new Scanner(System.in);
2.
String s1 = nextLine();
Here object scan is missing to call nextLine() method of class Scanner
Corrected statement:
String s1 = scan.nextLine();
3.
String s2 = Scanner.nextLine();
Here class is used instead of its object scan to access the method nextLine
Corrected statement:
String s2 = scan.nextLine();
4.
String n = scan.nextLine();
Here n is of type String but n is a whole number so it should be of type int. Also the method nextInt will be used to scan and accept an integer value
Corrected statement:
int n = scan.nextInt();
5.
System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));
This statement is also not correct
Corrected statement:
System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));
This works as follows:
s1.substring(0,n) uses substring method to return a new string that is a substring of this s1. The substring begins at the 0th index of s1 and extends to the character at index n.
s2.substring(s2.length() - n ) uses substring method to return a new string that is a substring of this s2. The substring then uses length() method to get the length of s2 and subtracts integer n from it and thus returns the last n characters of s2.
The screenshot of program along with its output is attached.
What decides the amount of delay between shots on a digital camera?
Answer:
Some cameras have something called “shutter lag” which is the time it takes from the instant the shutter is pressed, until the instant the picture is taken. This can be very disruptive to the photographer, and although it is not possible to eliminate this delay, it is possible to minimize it a lot.
Explanation:
One of the main causes of shutter lag in dSLR cameras is the mirror that allows you to preview the image, since it needs to be raised in order for the light to reach the sensor. This time is minimal, however, and varies from camera to camera.
The focus delay exists in professional cameras as well and needs to be avoided in the same way, but the time it takes for the lens to clear the image, in these cases, is slightly less. Another factor that contributes to the photographer is the use of manual focus, completely eliminating this type of shutter lag.
Another type of delay that occurs is the image processing time by the sensor. This is not really a shutter lag, since it occurs after the photo was taken, but it can hinder the capture of sequential photos, as many cameras spend several seconds processing the same image.