Answer:
ONE
Explanation:
The output is one if x is equal to 9 % 2
Class description: A MyString class should behave much like the c++ string class. The class should use a dynamically allocated char array to hold a character string. If the amount of memory allocated to the array is too small to complete some necessary task (e.g., assigning a new character string to the object) the object should automatically double its capacity until it is large enough to complete the task. If it's discovered that the object is using less than 25% of its capacity the object should shrink to half its capacity until it is using more that 25% of its capacity.
Assignment: Implement the MyString class using a header and implementation file named MyString.h and MyString.cpp respectively. Even though MyString.h will be provided on the upload site, create own version for testing code locally. Make sure to properly test code on by creating a test driver that fully tests every function created in the MyString class
Memory Requirements: MyString should start with 10 bytes of allocated memory and should grow in size by doubling. So, we should be able to predict the capacity of MyString as acquiring a patten of 10, 20, 40, 80, ⦠bytes of memory depending of the number of characters stored.
Attributes:
int size â the number of characters currently stored in the string object. Do NOT count the NULL character.
int capacity â the number of bytes currently allocated. This should always be at least size + 1. The extra byte is needed to store the NULL character.
char *data â character pointer that points to an array of characters.
Member Functions:
MyString( ) Constructor
MyString(const char *) Constructor with an initialization character string
~MyString( ) Destructor
MyString(const MyString &) Copy constructor
MyString& operator = (const MyString&) Overloaded assignment operator, make a copy of MyString object
bool operator == (const MyString&) const overloaded equivalence relational operator
char& operator [ ] (int) overloaded [ ] should return a char by reference
void operator += (const MyString&) overloaded += operator, use to concatenate two MyStrings
MyString operator + (const MyString&) const Create a new MyString object that is the concatenation of two MyString objects
void getline(istream&, char delimit = â\nâ); reads an entire line from a istream. Lines are terminated with delimit which is newline â\nâ by default
int length( ) const; return the length of the string
friend ostream& operator<< (ostream&, MyString&); overloaded insertion operator
what is an operating system
Answer:
Explanation:
Online Dictionary defines 'Operating System' as "the software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.''
Hope this helps!
The text help readers understand the relationship between gender and sports?THESE PUMPKINS SURE CAN KICK!
Answer:
What's the question?????I don't understand
What is a copyright?
the exclusive legal right, given to an originator or an assignee to print, publish, perform, film, or record literary, artistic, or musical material, and to authorize others to do the same.
Explain the five most important things that should be taken into consideration when designing a computer network.
Explanation:
Many computer experts (networkers) believe that you consider the following when designing a computer network:
Budget: By considering the amount available to be spent on setting up the computer network, it allows buying the best quality equipment considering the available funds.Type of network connectivity: This involves determining whether the network would only be a wireless connection or wired connection using cables, or involves both combinations.Type of security: This involves deciding the type of network security to be installed. Answering: Would it cloud systems be used? What type of firewall systems to use, etc?The type of hardware and software: This is very important in other to determine how optimal the network would be.Disaster recovery plan: For example, what type of back-up power would be required or affordable, solar power, or generator?_____ is a framework based on JavaScript and HTML that is normally used to make dynamic web apps.
a
Python
b
CSS
c
AngularJS
d
A database
Answer:
AngularJS (c)
Explanation:
Answer:
AngularJS
node is better
Explanation:
You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing their boarding pass. Due to federal regulations, there is a total of three different forms of ID that can potentially be used. You must determine whether the passenger has the sufficient identification to board the plane or not. Facts: ⢠A passport is enough for a boarding pass ⢠Without a passport, passengers must have two other forms of ID: driver's license birth certificate ⢠If the above two conditions are not met, then they are denied. Input Your solution must take in three boolean inputs. The first input represents whether they have a passport or not. The second input represents whether they have a driver's license or not. The third input represents whether they have a birth certificate or not Output The output should display as a boolean result whether they can board the plane or not. Sample Input Sample output true false false true false true true true false false false false
Answer:
Follows are the code to this question:
import java.util.*;//import package for user input
public class Main //defining class
{
public static void main(String[] as)//main method
{
boolean x,y,z;//defining boolean variable
Scanner ox= new Scanner(System.in);//create Scanner class object for user input
System.out.println("input value: "); //print message
x=ox.nextBoolean();//input value
y=ox.nextBoolean();//input value
z=ox.nextBoolean();//input value
System.out.println("Output: ");//print message
System.out.println(x || (y &&z));//use print method to check value and print its value
}
}
Output:
1)
input value:
true
false
false
Output:
true
2)
input value:
false
true
true
Output:
true
3)
input value:
false
false
false
Output:
false
Explanation:
In the given code, inside the class three boolean variable "x,y, and z" is declared, that uses the scanner class for input the value from the user end, and in the next print, the method is declared, that uses " OR and AND" gate for calculating the input value and print its value.
In the AND gate, when both conditions are true. it will print the value true, and in the OR gate, when one of the conditions is true, it will print the value true.
Write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator). Your program should then divide the numerator by the denominator, and display the quotient followed by the remainder.Hint: If you use division (/) to calculate the quotient, you will need to use int() to remove the decimals. You can also use integer division (// ), which was introduced in Question 10 of Lesson Practice 2.3.Once you've calculated the quotient, you will need to use modular division (%) to calculate the remainder. Remember to clearly define the data types for all inputs in your code. You may need to use float( ) , int( ), and str( ) in your solution.float( ): Anything inputted by a user should be transformed into a float — after all, we are accepting ALL positive numbers, integers and those with decimals.int( ): When you divide the numerator and the divisor using /, make sure that the result is an integer.str( ): After using modular division, you can transform the quotient and remainder back into strings to display the result in the print() command.
Answer:
did you end up getting an answer
Explanation:
Lifelong learning ____?
A. stops when your career is over
B. only occurs in a classroom setting
C. begins after you retire
D. can be informal
Answer:
can be informal
Explanation:
just took the Unit Test
A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies. Below is an example file along with the program input and output: example.txt I AM SAM I AM SAM SAM I AM
Answer:
Here is the Python program:
filename=input('Enter the file name: ') #prompts to enter file name
file = open(filename,"r+") #opens file in read mode
dict={} #creates a dictionary
for word in file.read().split(): #reads and splits the file and checks each word in the file
if word not in dict: #if word is not already present in dictionary
dict[word] = 1 #sets dict[word] to 1
else: #if word is already in the dictionary
dict[word] += 1 #adds 1 to the count of that word
file.close(); #closes file
for key in sorted(dict): #words are sorted as per their ASCII value
print("{0} {1} ".format(key, dict[key])); #prints the unique words (sorted order) and their frequencies
Explanation:
I will explain the program with an example:
Lets say the file contains the following contents:
I AM SAM I AM SAM SAM I AM
This file is read using read() method and is split into a list using split() method so the file contents become:
['I', 'AM', 'SAM', 'I', 'AM', 'SAM', 'SAM', 'I', 'AM']
for word in file.read().split():
The above for loop checks file contents after the contents are split into a list of words. So if statement if word not in dict: inside for loop checks if each item in the list i.e. each word is not already in dict. It first checks word 'I'. As the dictionary dict is empty so this word is not present in dict. So the statement dict[word] = 1 executes which adds the word 'I' to dict and sets it to 1. At each iteration, each word is checked if it is not present in dictionary and sets its count to 1. This way the words 'I', 'AM' and 'SAM' count is set to 1. Now when 'I' appears again then this if condition: if word not in dict: evaluates to false because 'I' is already present in the dict. So else part executes dict[word] += 1 which adds 1 to the count of this word. So frequency of 'I' becomes 2. Now each time when 'I' in encountered its count is incremented by 1. Since 'I' appears three times so frequency of 'I' is 3.
After all the words are checked and the loop ends, the next for loop for key in sorted(dict): uses sorted method to sort the items in dict in alphabetical order then check each key of the dict and prints the key value along with it frequency. So the output of the entire program is:
AM 3 I 3 SAM 3
The screenshot of program along with its output is attached.
Why was the newspaper readership the highest in 1995?
If the machine executes 5000 instructions every microsecond (millionth of a second), how many instructions does the machine execute during the time between the typing of two consecutive characters?
Answer:
5*10^9 instructions
Explanation:
Let's apply logic to solve this particular problem.
If 5000 instructions get executed in a millionth of a second, then this means that
5000 instructions gets executed every 1*10^-6 second
5000*10^6 instructions get executed every second, or say
5*10^9 instructions get executed after every second.
Going forward, it isn't stated how long it takes to type two consecutive characters, so will assume it's just 1 second(since it's consecutively).
So, succinctly put, if it takes 1 second to type the two characters consecutively, then the machine executed 5*10^9 instructions. And if it takes 2 seconds to type the two characters, then the machine would have executed 10*10^9 instructions
What’s command do we use to update a file on MySQL?
Answer:
The MySQL update command/query is used to update existing records in a table in a MySQL database.
how do you write 4 copies of 3 tenths in standard form
Answer:
four copies of three tenths
Explanation
just like you did it but its all in words
What do you use for soaking hands and holding soapy water
Answer:
a bowl
Explanation:
a round, deep dish or basin used for food or liquid.
plz mark brainliest
ASAP.
13. How do distracters impact your study time? They cause you to lose focus and lose time. They make studying almost impossible. They cause you to lose focus and that results in lower grades. They make you drowsy and distracted.
Answer:
A
Explanation:
You could pick any answer and make a case for it. It depends on what you have been told.
I would pick A but I wouldn't be surprised if the answer isn't the last one.
What does binary mean?
Os and 1s
O Decimals
O Digital
O User data
Answer:
0s and 1s
Explanation:
Answer:
0s and 1s
Explanation: when you talk about binary codes you are talking about the codes made up of 1s and 0s
Why would a user select More Items for mail merge fields? to manually set an IF-THEN logic for the data field to manually change what merge field data is shown to manually select the format of the name in the greeting line to manually select and place additional fields at an insertion point
Answer:to manually select and place additional fields at an insertion point
Explanation:
Answer:
D. to manually select and place additional fields at an insertion point
Explanation:
edg. 2020
100 POINTS!!!
Suppose a program requires a password that is a combination of numbers and letters but is not key sensitive. However, the user input is received as a string with letters that can have arbitrary cases. What code can be used to validate user input, u_pass, against the actual password, a_pass?
u_pass.upper() == str(a_pass).upper()
u_pass == a_pass
u_pass == str(a_pass)
u_pass is a_pass
The code that can be used to validate user input, u_pass, against the actual password, a_pass is u_pass.upper() == str(a_pass).upper().
How do one validate user input?The act of input validation is also called data validation. This is said to be the right testing of any input that has been supplied by a user or application.
Conclusively, In Input validation, there is prevention in term of improperly formed data from entering into the information system.
Learn more about coding from
https://brainly.com/question/22654163
Java Homework:(The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student andEmployee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date-hired. Define a class named MyDate that contains the fields year, month, and day. A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each class to display the class name and the person's name.
class Person{
//A person has a name, address, phone number, and email address.
String name;
String address;
String phone;
String email;
}
class Student extends Person{
//A student has a class status
//(freshman,sophomore, junior, or senior).
//Define the status as a constant.
final int freshman =1;
final int sophomore =2;
final int junior=3;
final int senior=4;
int status=freshman;
}
class Employee extends Person{
//An employee has an office, salary, and date hired.
String office;
double salary;
java.util.Date dateHired;
}
class Faculty extends Employee{
//A faculty member has office hours and a rank.
String officeHours;
String rank;
}
class Staff extends Employee{
//A staff member has a title
String title;
}
public class ex112{
}
The outline is given above. Fill in between brackets to finish! Thank you :)
Answer: Wait, so what is the question exactly..?
What is the tag used for?
Answer:
The title tag is an HTML title element critical to both SEO and user experience that is used to briefly and accurately describes the topic and theme of an online document. The title tag is displayed in two key places: Internet Browser – Title Tags display in the top bar of internet browsers.
In a user interface, a screen is best understood as
A.a console
b.a variable
c.an input
d. an element
Answer:
d. an element
Explanation:
User Interface design is simply the designs that are used to model a product like an application.
In a user interface, a screen is best understood as an element.
Can I publish my book on Google?
Answer:
☆|《HOPE IT WILL HELP YOU 》>☆
Explanation:
YES YOU CAN PUBLISH YOUR BOOK ON GOOGLE
please mark my ans as BRAIN LISTIn which of the following scenarios would it be best to use a for loop?
1. When you need to stop looping based on input from the user
2. When you need to check that a user's input is valid.
3. When you want to ask the user for 10 numbers
4. When you need to be able to use the block of code in many places in your program
Answer:
I would say 3 is the most likely answer ("When you want to ask the user for 10 numbers").
You use for loops to perform a task x times usually.
give the imporntance of having standard funiture in the laboratory
Answer:
I guess if there is experiment going on in absence one of those furniture then the experiment isn't successful
Create a Python file named num_sum.py that contains: The definition of two functions: volume - accepts three parameters and returns the product of them, but displays nothing sum_of_nums - accepts 1 or more numbers and returns their sum, but displays nothing A print function call that includes a call to volume, passing 2, 3, and 4 A print function call that includes a call to sum_of_nums, passing 1, 2, 3, 4, and 5 Submit the Python program and screenshot. Following is an example showing how your screenshot might look:
Answer:
def volume(n1, n2, n3):
product = n1 * n2 * n3
return product
def sum_of_nums(*args):
total = 0
for n in args:
total += n
return total
print("The product: " + str(volume(2, 3, 4)))
print("The sum: " + str(sum_of_nums(1, 2, 3, 4, 5)))
Explanation:
Create a function called volume that takes three parameters, n1, n2, n3
Multiply the n1, n2, n3 and set it to product
Return the product
Create a function called sum_of_nums that takes *args as parameter (Since the function may take one or more arguments, we may use *args)
Initialize the total as 0
Create a for loop that iterate through args. Add each number to the total (cumulative sum)
When the loop is done, return the total
Call the functions with given numbers and print the results
*See the output in the attachment.
Write a program that calculates and displays the amount ofmoney available in a bank account that initially has $8000 deposited in it and that earns interest atthe rate of 2.5 percent a year. Your program should display the amount available at the end of eachyear for a period of 10 years. Use the relationship that the money available at the end of each yearequals the amount of money in the account at the start of the year plus 0.025 times the amountavailable at the start of the year [20 points].
Answer:
Written in Python
import math
principal = 8000
rate = 0.025
for i in range(1, 11):
amount = principal + principal * rate
principal = amount
print("Year "+str(i)+": "+str(round(amount,2)))
Explanation:
This line imports math library
import math
This line initializes principal amount to 8000
principal = 8000
This line initializes rate to 0.025
rate = 0.025
The following is an iteration from year 1 to 10
for i in range(1, 11):
This calculates the amount at the end of the year
amount = principal + principal * rate
This calculates the amount at the beginning of the next year
principal = amount
This prints the calculated amount
print("Year "+str(i)+": "+str(round(amount,2)))
Computing devices translate digital to analog information in order to process the information
Answer:
True?
Explanation: is IT RIGHT?????????????????
kelly wants to buy a new operating system for a laptop. under which category will it be in online store?
Answer:
Kelly should look at the electronics section, where the laptops are because a laptop is an electronic. Just like an iPhone, iPad, and a TV.
Answer:
Application Software
Explanation:
What is Interface in computers
Answer:
An interface could be the design of the homescreen or the way a shell of a computer is designed. I could be wrong tho......
Explanation: