Answer:
The output will be "You passed the test."
Since 90 is greater than 60 .
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.
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
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 falseA security administrator is implementing a SIEM and needs to ensure events can be compared against each other based on when the events occurred and were collected. Which of the following does the administrator need to implement to ensure this can be accomplished?
a. TOTP
b. TKIP
c. NTP
d. HOTP
Answer:
The correct answer is option (a) TOTP
Explanation:
Solution
The correct answer is TOTP Because we need randomness and minor probability also change that's why TOTP (Time based One Time Password).
TOTP: A time-based one-time password (TOTP) refers a temporary pass code produced by an algorithm that utilizes the present time of day as one of its authentication factors.
Time-based one-time passwords are normally used for two-factor authentication and have seen growing assumption by cloud application providers.
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.
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)
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!
Front wheel drive vehicles typically use
Answer:
Front wheel drive vehicles usually use positive offset wheel
Explanation:
the typing area is bordered on the right side by bars in ms word
Answer:
Explanation:
PTA NHI
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).
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.
C++ 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 is given below
#include <iostream> // header file
#include<string> // header file
using namespace std; // namespace
int main() // main function
{
string fname,lname; // variable declaration
cin>>fname>>lname; // Read the input by user
cout<<lname; // print last name
cout<<", "; // display comma
cout<<fname<<endl; // display first name
return 0;
}
Output:
Maya Jones
Jones, Maya
Explanation:
Following are the description of program .
Declared a variable "fname" and the "lname" as the string datatype .Read the input by user in the "fname" and the "lname" variable by using cin function in c++.After that print the "lname" variable.then print the comma and finally print the "fname" variableDefine 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
Eliza needs to share contact information with another user, but she wants to include only certain information in the contact. What is the easiest way for her to achieve this?
Answer:
Use the edit business card dialog box to control the information.
Explanation:
Business card is an easiest way to share contact details with other persons. There are some reasons a person might not want to share entire details of the contact it has with the other person, for this purpose the business card outlook has an option to edit the information of contact before sending it to the other person. Click the contact card and select the relevant contact that needs to be shared, then double click the contact it will display an edit option.
Answer:
b
Explanation:
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 .Research and discuss the similarities and differences between cloud computing and client-server computing. Discuss the pros and cons of each.
Answer:
Cloud computing as a virtual hosting tool, is much more theoretical. Both servers, applications, and communications are hosted in the cloud, off property, rather than being available via computer machine whereas In computing client/server, a controller gets client requests mainframes and needs to share its services, programs and/or data of one sometimes more client systems on the internet, and a client would be a portable platform that specific portions with a server and make use of a finite resource.
Explanation:
Similar to cloud computing and client-server computing: -
The cloud computing and client-server networking underpinning principles are the same. That is contact between client and server. Throughout networking and client-server networking, user nodes can communicate (queries) with databases that live locally or are located in many other networks.Difference between computing and client-server computing: -
Resources: -
In computing client-server, the corporation or association controls the tools. The services are offered in cloud computing by third parties or other businesses.The purpose of cloud computing and client-server computing is different:-
Client-server computing is targeted at use. In computation, client-server clients request a product from the cloud. The operating system runs the test, then returns it. Cloud computing is a sort of system in which the IT-related services are leased to the clients as a contract.Pros and cons of Cloud Computing:-
The Pros:-
Lower costs for business:-The cloud is saving a lot of money for a medium-sized or small enterprise. Better Reliability:- A dedicated group of experts performs all programming with such a cloud computing alternative.The Cons:-
Limited Control:- When a firm stores cloud data, they have very limited control of it. There have been security issues. The cloud isn't too attuned for every company to position some information on even a cloud.Pros and cons of client-server computing:-
The Pros:-
Improved data sharing:- Data stored via the normal business method and processed on a server is available over an approved connection for the intended users. Security:- Database has stronger access control and methods to ensure data could only be accessed or abused by approved clients.The Cons:-
Overloaded Servers:- When multiple simultaneous requests from the client are made, the server is significantly overloaded, causing congestion in traffic. Impact of centralized architecture:- Because it is centralized if a vital server fails to satisfy customer requests, the client-server then lacks good network robustness.
________ 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)
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.
C# Create a program named DemoSquares that instantiates an array of 10 Square objects with sides that have values of 1 through 10 and that displays the values for each Square. The Square class contains fields for area and the length of a side, and a constructor that requires a parameter for the length of one side of a Square. The constructor assigns its parameter to the length of the Square’s side field and calls a private method that computes the area field. Also include read-only properties to get a Square’s side and area.
Answer:
Here is the C# program.
using System; //namespace for organizing classes
public class Square //Square class
//private fields/variables side and area of Square class
{ private double side;
private double area;
//Side has read only property to get Square side
public double Side {
get { return this.side; }
}
//Area has read only property to get Square area
public double Area {
get { return this.area; } }
/*constructor Square(double length) that requires a parameter for the length of one side of a Square. The constructor assigns its parameter to the length of the Square’s side field and calls a private method SquareArea() that computes the area field */
public Square(double length) {
this.side = length;
this.area = SquareArea(); }
//method to calcuate area of a square
private double SquareArea() {
//Pow method is used to compute square the side i.e. side^2
return Math.Pow(this.side, 2); } }
public class DemoSquares {
public static void Main() { //start of main() function body
//displays the side and area on output screen
Console.WriteLine("{0}\t{1}\t{2}", "No.", "Side Length ", "Area");
//instantiates an array to input values 1 through 10 into Side
Square[] squares = new Square[10]; //squares is the instance
for (int i = 1; i < squares.Length; i++) {
//traverses through the squares array until the i exceeds the length of the //array
squares[i] = new Square(i);
//parameter is passed in the constructor
//new object is created as arrray is populated with null members
Square sq = squares[i];
/*display the no, side of square in area after setting the alignment to display the output in aligned way and with tab spaces between no side and area */
Console.WriteLine("{0}\t{1,11}\t{2,4}", i, sq.Side, sq.Area); }
//ReadKey method is used to make the program wait for a key press from //the keyboard
Console.ReadKey(); } }
Explanation:
The program is well explained in the comments mentioned with each statement of the program. The program simply has Square class which contains area and length of side as fields and a constructor Square which has length of one side of Square as parameter and assigns its parameter to length of Square side. The a private method SquareArea() is called that computes the area field. get methods are used to include read-only properties to get a Square’s side and area. The program along with its output is attached in the screenshot.
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
A network technician sets up an internal dns server for his local network. When he types in a url which is checked first
Answer:
The first thing that the browser checks is the cache for the DNS record to find the corresponding IP address.
Explanation:
After the technician sets up the internal DNS server for his local network, the first thing that is checked when he types a website into the url of a browser is the cache to look for corresponding IP addresses.
DNS which means Domain Name System is a database that maintains the website name (URL) and the IP address that it is linked to. There is a unique IP address for every URL (universal resource locator).
Internal DNS servers store names and IP addresses for internal or private servers
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 .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
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.
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
What 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
list and the deference between MS access objects
Answer:
MS access objects help the user list , information and designed reports .
Explanation:
MS access objects are create a forms, data base, tables,queries, and modules. There are many objects are following:-Tables, Forms,Reports, Queries.
Table:- These are objects used into a define and store the data,tables are contain the columns and the store of different data.
Form:- Form is the object that designed by the data input and control application queries or tables, forms are used in viewing records.
Reports:- Reports are the designed to the printing and calculating data,reports are used because data in read to easy format.
Queries:- Queries are provides that data from one or more table,you can define the update ,delete, insert, select data.
When Adobe Photoshop was released for the first time? A: 1984 B: 1990 C: 1991 D: 1992
Answer:
B
Explanation:
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;
}