Answer:
I am writing a function using C++ programming language. Let me know if you want the program in some other programming language.
void PrintFeetInchShort(int numFeet , int numInches){
cout<<numFeet<<"\' "<<numInches<<"\"";
The above function takes two integer variables numFeet and numInches as its parameters. The cout statement is used to print the value of numFeet with a single quote at the end of that value and print the value of numInches with double quotes at the end of that value. Here \ backslash is used to use the double quotes. Backslash is used in order to include special characters in a string. Here i have used backslash with the single quote as well. However it is not mandatory to use backslash with single quote, you can simply use cout<<numFeet<<"' " to print a single quote. But to add double quotes with a string, backslash is compulsory.
Explanation:
This is the complete program to check the working of the above function.
#include <iostream> // to use input output functions
using namespace std; //to identify objects like cout and cin
void PrintFeetInchShort(int numFeet , int numInches){
//function to print ' and ' short hand
cout<<numFeet<<"\' "<<numInches<<"\""; }
int main() { //start of the main() function body
PrintFeetInchShort(5, 8); }
//calls PrintFeetInchShort() and passes values to the function i.e. 5 for //numFeet and 8 for numInches
If you want to take the values of numFeet and numInches from user then:
int main() {
int feet,inches; // declares two variables of integer type
cout<<"Enter the value for feet:"; //prompts user to enter feet
cin>>feet; //reads the value of feet from user
cout<<"Enter the value for inch:"; //prompts user to enter inches
cin>>inches; //reads the value of inches from user
PrintFeetInchShort(feet, inches); } //calls PrintFeetInchShort()
The screenshot of the program and its output is attached.
What is output?
public abstract class Vehicle {
public abstract void move(int miles);
public void printInfo({
System.out.print("Vehicle ");
public class Car extends Vehicle {
private int distance;
public void move(int miles) {
distance = distance + miles;
public void printInfo() {
System.out.print("Car ");
}
public static void main(String args[]) {
Vehicle myVehicle;
Car myCar;
myVehicle = new Vehicle();
myCar = new Car();
myVehicle.printInfo();
myCar.printInfo();
}
}
Error: Car is not abstract and does not override abstract method move()
Vehicle
Vehicle Car
Error: Vehicle is abstract and cannot be instantiated
Answer:
The output is:
Error: Vehicle is abstract and cannot be instantiated
Explanation:
The following statement is causing this error:
myVehicle = new Vehicle();
Here an instance of Vehicle is being created. The name of the instance is myVehicle. new keyword is used to create an object or instance of class like here the instance myVehicle of class Vehicle is being created.
This instance cannot be created because the Vehicle is an abstract class. As you can see this statement public abstract class Vehicle.
So Vehicle class is declared with abstract keyword which means that this is an abstract class and cannot be instantiated. So Vehicle class is an abstract class and abstract class can only be used as a base class for its derived classes. Vehicle just provides with the basic functionality that its sub or derived class like Car can implement.
This class can be extended or inherited but no instance can be created of this class, as the Car class is used to extend the functionality of Vehicle class. Now you can create instance of Car class but NOT of a Vehicle class because it is an abstract class.
What is the target audience of an ad?
All ages
Explanation:
It is a toothpaste advert which most people use. It will also appeal to people who want to get whiter teeth
Answer:
A community of people advertisers want to reach.
Explanation:
How to fix the acount when it says "Uh oh, this account has been restricted because of an unusual amount of activity.
Answer:
Make sure that the email is verified. Also, usually sites do this when there are multiple log ins on multiple devices. It makes the site think that you are in multiple places at once making it seem suspicious. What i would do is clear cache and change the email and password associated with the account. If all fails contact brainly support
Write a program named Lab7B that will read 2 strings and compare them. Create a bool function named compareLetters that will accept 2 string variables as parameters and will return true if the strings have the same first letters and the same last letters. It will return a false otherwise.
Answer:
import java.util.*;
public class Lab7B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter first String");
String word1 = in.next();
System.out.println("Enter Second String");
String word2 = in.next();
System.out.println(compareLetters(word1,word2));
}
public static boolean compareLetters(String wrd1, String wrd2){
int len1 = wrd1.length();
int len2 = wrd2.length();
if(wrd1.charAt(0)==wrd2.charAt(0)&&wrd1.charAt(len1-1)==wrd2.charAt(len2-1)){
return true;
}
else{
return false;
}
}
}
Explanation:
Using Java Programming LanguageImport Scanner class to receive user inputPrompt user for two string and save in variablesCreate the compareLetters method to accept two string parametersUsing the charAt() function extract the first character (i.e charAt(0)). Extract also the last character (charAt(lengthOfString-1)Use if statement to compare the first and last characters and return true or falseWhat variable can be changed when using the WEEKDAY function
Answer:
This brainly page should be able to help, make sure to thank them if it's correct
https://brainly.com/question/15076370
Answer:
B the day of the week that starts week
Explanation:
just took it
Define a function begins_with_line that consumes a string and returns a boolean indicating whether the string begins with a dash ('-') or a underscore '_'. For example, the string "-Yes" would return True but the string "Nope" would return False. Note: Your function will be unit tested against multiple strings. It is not enough to get the right output for your own test cases, you will need to be able to handle any kind of non-empty string. Note: You are not allowed to use an if statement.
Answer:
The program written in python is as follows:
def begins_with_line(userinut):
while userinut[0] == '-' or userinut[0] == '_':
print(bool(True))
break;
else:
print(bool(not True))
userinput = input("Enter a string: ")
begins_with_line(userinput)
Explanation:
The program makes use of no comments; However, the line by line explanation is as follows
This line defines the function begins_with_line with parameter userinut
def begins_with_line(userinut):
The following italicized lines checks if the first character of user input is dash (-) or underscore ( _)
while userinut[0] == '-' or userinut[0] == '_':
print(bool(True)) ->The function returns True
break;
However, the following italicized lines is executed if the first character of user input is neither dash (-) nor underscore ( _)
else:
print(bool(not True)) -> This returns false
The main starts here
The first line prompts user for input
userinput = input("Enter a string: ")
The next line calls the defined function
begins_with_line(userinput)
NB: The program does not make use of if statement
Use function GetUserInfo to get a user's information. If user enters 20 and Holly, sample program output is:Holly is 20 years old. #include #include void GetUserInfo(int* userAge, char userName[]) { printf("Enter your age: \n"); scanf("%d", userAge); printf("Enter your name: \n"); scanf("%s", userName); return;}int main(void) { int userAge = 0; char userName[30] = ""; /* Your solution goes here */ printf("%s is %d years old.\n", userName, userAge); return 0;}
Answer:
Replace
/*Your solution goes here*/
with
GetUserInfo(&userAge, userName);
And Modify:
printf("%s is %d years old.\n", userName, userAge)
to
printf("%s is %d years old.", &userName, userAge);
Explanation:
The written program declares userAge as pointer;
This means that the variable will be passed and returned as a pointer.
To pass the values, we make use of the following line:
GetUserInfo(&userAge, userName);
And to return the value back to main, we make use of the following line
printf("%s is %d years old.", &userName, userAge);
The & in front of &userAge shows that the variable is declared, passed and returned as pointer.
The full program is as follows:
#include <stdio.h>
#include <string.h>
void GetUserInfo(int* userAge, char userName[]) {
printf("Enter your age: ");
scanf("%d", userAge);
printf("Enter your name: ");
scanf("%s", userName);
return;
}
int main(void) {
int* userAge = 0;
char userName[30] = "";
GetUserInfo(&userAge, userName);
printf("%s is %d years old.", &userName, userAge);
return 0;
}
Patrick Stafford's article argues that the growth of mobile phone usage "has given developers the ability to great robust and engaged communities" that help a game's chance of success.
a. true
b. false
Answer:
The statement is False.
Explanation:
In his article published on the 31st Aug 2010, Patrick suggests that a 100% penetration rate for any market is now possible due to the growth of the use of mobile phones.
The strategy of accessing the market using mobile ads, according to Patrick, is called Mobile Marketing.
In his article, Patrick provides statistics which help buttress his position that a good number of mobile phone users are ready to respond positively to mobile ads.
While it is implied that this concept has increased the chances of mobile games as a product being successful, nowhere in the article did Patric mention "games".
Cheers!
Instead of typing an individual name into a letter that you plan to reuse with multiple people, you should use a _______ to automate the process.
A. mail merge
B. data source
C. mailing list
D. form letter
ONLY ANSWER IF YOU'RE 100% SURE.
Answer:
A. Mail Merge
Explanation:
I had this question last year
Observe the things at Home in which you are using binary
conditions (ON/OFF) and Draw these things (any five).
Explanation:
All five things i can come up with her
1. Doors (we either open or close them)
2. Tap (we either open or close the valve)
3. Electric stove/cooker
4. The lid of containers
5. Shoes/ foot wears(we put them ON or OFF)
Drug addiction occurs in
age groups, from a
variety of backgrounds.
A. young, narrow
B. all, narrow
C. all, wide
Answer:
ig the answer is C :) sorry if isn't correct
The operating system cannot communicate with a mouse. What is a solution?
Choose the answer.
Update the mouse device driver.
Run an antimalware program.
Delete temporary files.
Run the task manager utility.
Answer:
Update the mouse device driver
Explanation:
In a situation where the operating system cannot communicate with a mouse the solution will be to Update the mouse device driver reason been that Mouse Driver is often and always needed to help the motherboard to interact with the device and It is also a software that works between the Operating System and the Mouse because It can effectively and efficiently translates the signals to the motherboard in an appropriate manner or ways which is why Microsoft’s generic drivers are enough and efficient for proper interaction between the Mouse and the Operating System.
________ platforms automate tasks such as setting up a newly composed application such as a web service or linking to other applications.
Answer:
Cloud-based
Explanation:
Cloud based platforms are the various platforms that leverage on the power of cloud computing. With these platforms, users or businesses can access some or all features and files of a system without having to store these files and features on their own computers. Some of these platforms also automate tasks such as setting up various applications (such as a web service, a web application, database systems e.t.c) and/or linking them to other applications. Some of these platforms are;
i. Google Drive
ii. Amazon Web Services (AWS)
If you face an investigation where dangerous substances might be around, you may need to obtain which of the following?
A. DANMAT certificate
B. DANSUB certificate
C. HAZMAT certificate
D. CHEMMAT certificate
Answer:
HAZMAT certificate
Explanation:
If you face an investigation where dangerous substances might be around, you may need to obtain a HAZMAT certificate.
Hazmat is the shortened form of the word "hazardous materials," which the United State Department of Transportation recognized as materials that could adversely affect people and also the environment. Hazmat certification is required to be obtained by workers who remove, handle, or transport hazardous materials. This comprises careers in transportation and shipping, firefighting and emergency rescue, construction and mining, as well as waste treatment and disposal. Workers who are also in manufacturing and warehouse storage may also come across hazardous substance or materials risks while on their jobs. Certification involves having the knowledge of the risks and safety measures for handling these materials.
Answer:
(C) HAZMAT certificate
Explanation:
HAZMAT stands for Hazardous Materials. These are materials that could adversely affect people and the environment. Examples are synthetic organic chemicals, heavy metals and radioactive materials. People who work in certain industries such as construction and mining, firefighting, waste treatment and disposal e.t.c, are required to have this certificate.
The certification involves training workers in these industries in the use of, risk involved, and way of handling of these materials when they are encountered at work.
On a system with paging, a process cannot access memory that it does not own. Why? How could the operating system allow access to other memory?
Answer:
Because the page is not in its page tableThe operating system could allow access to other memory by allowing entries for non-process memory to be added to the process page tableExplanation:
On a system with paging, a process cannot access memory that it does not own because the page is not in its page table also the operating system controls the contents of the table,therefore it limits a process of accessing to only the physical pages allocated to the process.
The operating system could allow access to other memory by allowing entries for non-process memory to be added to the process page table.that way two processes that needs to exchange data can efficiently do that . i.e creating a very efficient inter-process communication
A project manager is responsible for (check all that apply)
A. addressing and seeking help on ethical issues
B. his/her client's company stock price
C. solving project technical issues and team conflicts
D. knowing and following rules and procedures related to the project
Answer:
The answers that are right are options A, C, and D.
Explanation:
Hope this helps!
Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter a value. The program multiplies the value by 10 and outputs the result
Answer:
Here is your pseudocode:
Declare number and result
Get number
Set result = number * 10
Print result
Explanation:
Declare two variables, number and result
Ask the user to enter the number
Multiply the number by 10 and set it to the result
Print the result
In programming, flowcharts and pseudocodes are used as types of algorithms used as models of actual programs.
The pseudocode is as follows:
Input num
Display num * 10
The flow of the above pseudocode is as follows
The first line of the pseudocode gets input for num The second line prints the product of the user input and 10
The above explanation is also applicable to the flowchart (see attachment)
Read more about flowcharts and pseudocodes at:
https://brainly.com/question/24735155
draw the flowchart to calculate the area of the rectangle 50m length and width 30m.
Answer:
---- ----
Explanation:
1) Start
2) Rectangle: Read Length and Width.
3) Calculate
4) Print (Calculate)
Write a program that inputs a sentence from the user (assume no punctuation), then determines and displays the unique words in alphabetical order. Treat uppercase and lowercase letters the same.
Answer:
Following are the code to this question:
val={} #defining dictionary variable val
def unique_word(i):#defining a method unique_word
if i in val: #defining if condition to add value in dictonary
val[i] += 1#add values
else: #defining else block to update values
val.update({i: 1})#updating dictionary
s =input('Enter string value: ') #defining s variable for input string value
w=s.split()#split string value and sorte in w variable
w.sort() #sorting the value
for i in w: #defining loop for pass value in method unique_word
unique_word(i)#assign value and calling the unique_word method
for j in val:# defining for loop to print dictionary value
if val[j] == 1: #defining if block to check value is unique
print(j) #print value
Output:
Enter string value: my name is dataman
dataman
name
is
my
Explanation:
In the above python code, a dictionary variable "val" is declared, which is used in the method "unique_word" that uses if block to count unique word and in the else block it update its value. In the next step, s variable is declared, that the user input method to store the value and another variable "w" is defined that split and sort the string value. In the last step, two for loop is declared in which the first loop passes the string value and calls the method "unique_word", and in the second loop if block is defined that check unique value and prints its value.When Adobe Photoshop was released for the first time? A: 1984 B: 1990 C: 1991 D: 1992
Answer:
B
Explanation:
CHALLENGE ACTIVITY 2.15.1: Reading and outputting strings. Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya.
Answer:
Following are the program in Java language
import java.util.*; // import package
public class Main // main function
{
public static void main(String[] args) // main class
{
String l_name,f_name; // variable declaration
Scanner sc6=new Scanner(System.in); // scanner class
f_name= sc6.next(); // Read input
l_name=sc6.next(); // Read input
System.out.print(l_name); // display last name
System.out.print(","); // display comma
System.out.println(f_name); // display first name
}
}
Output:
Maya Jones
Jones, Maya
Explanation:
Following are the description of program
Declared a variable 'l_name","f_name" as the string type .Create the instance of scanner class i.e "sc6".Read the user input by using the instance "sc6" of the scanner class in the variable "l_name" and "f_name ".Finally by system.print() method we will display the value according to the format in the given question .An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________ part of an established curriculum. Curricular practical training is defined to be alternative work/study, internship, cooperative education, or any other type of required internship or practicum that is offered by sponsoring employers through cooperative _____________ with the school. Students who have received one year or more of full time curricular practical training are ineligible for post-completion academic training. Exceptions to the one academic year requirement are provided for students enrolled in _____________ studies that require immediate participation in curricular practical training. A request for authorization for curricular practical training must be made to the DSO. A student may begin curricular practical training only after receiving his or her Form I-20 with the __________ endorsement.
Answer:
1. Student.
2. Integral.
3. Agreements.
4. Graduate program.
5. DSO.
Explanation:
An F-1 student may be authorized by the DSO to participate in a curricular practical training program that is an integral part of an established curriculum. Curricular practical training is defined to be alternative work/study, internship, cooperative education, or any other type of required internship or practicum that is offered by sponsoring employers through cooperative agreement with the school. Students who have received one year or more of full time curricular practical training are ineligible for post-completion academic training. Exceptions to the one academic year requirement are provided for students enrolled in graduate program studies that require immediate participation in curricular practical training. A request for authorization for curricular practical training must be made to the DSO. A student may begin curricular practical training only after receiving his or her Form I-20 with the DSO endorsement.
Please note, DSO is an acronym for Designated School Official and they are employed to officially represent colleges or universities in the United States of America. They are saddled with the responsibility of dealing with F-1 matters (a visa category for foreign students seeking admission into schools such as universities or colleges in the United States of America).
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in the file. You function should be case-insensitive so 'Hello' and 'hello' are treated as the same word. You should ignore words of length 2 or less. Test your implementation on file great_expectations.txt¶
Answer:
I am writing a Python program:
import string # here is this is used in removing punctuation from file
def wordcount(filename): #definition of wordcount method that takes file name as argument
file = open(filename, "r") #open method opens the file whose name is specified and r is for read mode. Object "file" is used to open a file in read mode
count = dict() #creates a dictionary
for strings in file: # iterates through every line of the text file
strings = strings.strip() #strip() method removes the white spaces from every line of the text file
strings = strings.lower() #converts all the characters of the text file to lower case to make function case insensitive
strings = strings.translate(strings.maketrans("", "", string.punctuation)) # deletes punctuation each line of the text file
words = strings.split(" ") #split the lines of file to a list of words
for word in words: #iterates through each words of the list of words
if len(word)>2: #ignores words of length 2 or less
if word in count: #if word is present in dictionary count already
count[word] = count[word] + 1 #then add 1 to the existing word count
else: #if the word is not present already in the dictionary
count[word] = 1 # set the count of the word that is not already present to 1 in order to add that word to dictionary
for key in list(count.keys()): # iterates through each key (words) in the list of words and print the contents of dict counts i.e. words along with their no. of occurrences
print(key, ":", count[key]) # print the words and their occurences in word:occurence format for example hello:1 means hello exists once in text file
file.close() #closes the file
#two statements first ask the user to enter the name of the file and then call the function wordcount() by passing the name of that file in order to print the number of occurrences of every word in the file.
name = input('Enter a filename: ')
wordcount(name)
Explanation:
The program is well explained in the comments above. The program has a function wordcount() that takes a text file name as its parameter. First it opens that file in read mode. Then the first for loop moves through each line of the text file and removes the white spaces from every line of the text file using split() method, converts all the characters of the text file to lower case to make function case insensitive using lower() method, deletes punctuation each line of the text file using maketras() method and translate methods. maketrans() method specify the list of punctuation that need to be remove from the each line of the file. This method then returns this list in the form of a table which is passed to translate() method. Then translate() method uses this table to modify lines in order to remove the punctuation from lines. Next the lines are split into list of words using split() method. Then the second for loop moves through each word and counts the number of occurrences of each word in the text file. len(word)>2: len function returns the length of the word and if the length of the word is less than 2 than that word is ignored. count is set to 1, every time a new word is added to dictionary and if the word is already present in the dictionary then the count of word is incremented by 1. At the end the contents of dictionary are displayed in key: count[key] format in which key is each word and value is the number of occurrences of that word. Since the great_explectations.txt file is not attached so i have used my own file. You can use this code for you file.
Which statement is false?If a value should not change in the body of a function to which it is passed, the value should be defined const to ensure that it is not ac-cidentally modified.Attempts to modify the value of a variable defined const are caught at execution time.One way to pass a pointer to a function is to use a non-constant pointer to non-constant data.It is dangerous to pass a non-pointer into a pointer argument.
Answer:
Attempts to modify the value of a variable defined const are caught at execution time
Explanation:
The false statement among the options is Attempts to edit the value of a variable defined const are caught at execution time while other options are true.
A const variable should not be modify because the main reason of having a const variable is not to make modifying it possible. If you prefer a variable which you may likely want to modify at some point, then don't just add a const qualifier on it. Furthermore, Any code which modify's a const by force via (pointer) hackery invokes Undefined Behavior
the typing area is bordered on the right side by bars in ms word
Answer:
Explanation:
PTA NHI
Although the term podcasting has caught on, a more accurate term when it applies to video content is ________. a. tubecasting b. webcasting c. vcasting d. viewcasting
Answer:
The answer is option (c) vcasting
Explanation:
Solution
Vcasting for video content are more exact terms to use in place of podcast and podcasting.
Video content or vcasting: It refers any content format that attribute or contains video. common forms of video content are vlogs, animated GIFs, customer testimonials, live videos, recorded presentations and webinar.
You are designing an internet router that will need to save it's settings between reboots. Which type of memory should be used to save these settings
Answer:
Flash memory is the correct answer to the given question .
Explanation:
The Flash memory is the a non-volatile memory memory that removes the information in the components known as blocks as well as it redesigns the information at the byte level.The main objective of flash memory is used for the distribute of the information.
We can used the flash memory for preserving the information for the longer period of time, irrespective of if the flash-equipped machine is enabled or the disabled.The flash memory is constructing the internet router that required to save the settings among the rewrites by erasing the data electronic and feeding the new data .Front wheel drive vehicles typically use
Answer:
Front wheel drive vehicles usually use positive offset wheel
Explanation:
reate a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the Plane class and test its functionality. Write a method called CheckIn() as part of the Plane class to handle the check in process Prompts the user to enter 1 to select First Class Seat (Choice: 1) Prompts the user to enter 2 to select Economy Seat (Choice: 2) Assume there are only 5-seats for each First Class and Economy When all the seats are taken, display no more seats available for you selection Otherwise it displays the seat that was selected. Repeat until seats are filled in both sections Selections can be made from each class at any time.
Copy the countdown function from Section 5.8 of your textbook. def countdown(n): if n <= 0: print('Blastoff!') else: print(n) countdown(n-1) Write a new recursive function countup that expects a negative argument and counts "up" from that number. Output from running the function should look something like this: >>> countup(-3) -3 -2 -1 Blastoff! Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.) If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call (countdown or countup) for input of zero. Provide the following. The code of your program. Output for the following input: a positive number, a negative number, and zero. An explanation of your choice for what to call for input of zero.
Answer:
def countdown(n):
if n <= 0:
print('Blastoff!')
else:
print(n)
countdown(n-1)
def countup(n):
if n >= 0:
print('Blastoff!')
else:
print(n)
countup(n+1)
number = int(input("Enter a number: "))
if number >= 0:
countdown(number)
elif number < 0:
countup(number)
Outputs:
Enter a number: 3
3
2
1
Blastoff!
Enter a number: -3
-3
-2
-1
Blastoff!
Enter a number: 0
Blastoff!
For the input of zero, the countdown function is called.
Explanation:
Copy the countdown function
Create a function called countup that takes one parameter, n. The function counts up from n to 0. It will print the numbers from n to -1 and when it reaches 0, it will print "Blastoff!".
Ask the user to enter a number
Check if the number is greater than or equal to 0. If it is, call the countdown function. Otherwise, call the countup function.
Recursive functions calls themselves in a function, until a certain condition is met. It allows us to get rid of repetitive function calls. Hence, the recursive function for the action is given thus :
def countdown(n):
#initialize countdown function :
if n <= 0:
#blast off condition
print('Blastoff!')
else:
print(n)
countdown(n-1)
#recursion
def countup(n):
#initialize countuo function
if n >= 0:
#blast off condition
print('Blastoff!')
else:
print(n)
countup(n+1)
number = int(input("Enter a number: "))
#takes input from user
if number >= 0:
countdown(number)
else:
number < 0:
countup(number)
Learn more : https://brainly.com/question/20702793