Answer:
#include "hugeint1.h"
#include
using namespace std;
int main()
{
HugeInteger n1( 7654321 );
HugeInteger n2( 7891234 );
HugeInteger n3;
HugeInteger n4( 5 );
HugeInteger n5;
n5 = n1.add( n2 );
n1.output();
cout << " + "; n2.output();
cout << " = "; n5.output();
cout << "\n\n";
n5 = n2.subtract( n4 );
n2.output();
cout<< " - "; n4.output();
cout << " = "; n5.output();
cout << "\n\n";
if ( n1.isEqualTo( n1 ) == true )
{
n1.output();cout << " is equal "; n1.output(); cout << "\n\n";
}
if ( n1.isNotEqualTo( n2 ) == true )
{
n1.output();cout << " is not equal to ";n2.output();cout << "\n\n";
}
if ( n2.isGreaterThan( n1 ) == true )
{
n2.output();cout << " is greater than ";n1.output();cout <<"\n\n";
}
if ( n2.isLessThan( n4 ) == true )
{
n4.output();cout << " is less than ";n2.output();cout << "\n\n";
}
if( n4.isLessThanOrEqualTo( n4 ) == true )
{
n4.output();cout << " is less than or equal to ";n4.output();
cout << "\n\n";
}
if ( n3.isGreaterThanOrEqualTo( n3 ) == true )
{
n3.output();cout << " is greater than or equal to ";n3.output();
cout << "\n\n";
}
if ( n3.isZero() != true )
{
cout << "n3 contains value ";n3.output();cout << "\n\n";
}
return 0;
}
//class definitions
#ifndef HUGEINT1_H
#define HUGEINT1_H
class HugeInteger {
public:
HugeInteger( long = 0 );
HugeInteger add( const HugeInteger & );//addition operator; HugeInt + HugeInt
HugeInteger subtract( const HugeInteger & );//subtraction operator; HugeInt - HugeInt
bool isEqualTo( HugeInteger & );
bool isNotEqualTo( HugeInteger & );
bool isGreaterThan(HugeInteger & );
bool isLessThan( HugeInteger & );
bool isGreaterThanOrEqualTo( HugeInteger & );
bool isLessThanOrEqualTo( HugeInteger & );
bool isZero();
void output();
short* getInteger()
{
return integer;
}
private:
short integer[ 40 ];
};
#endif
//implemetations
#include using std::cout;
#include "hugeint1.h"
HugeInteger::HugeInteger( long value )
{
for ( int i = 0; i < 40; i++ )
integer[ i ] = 0;
for ( int j = 39; value != 0 && j >= 0; j-- )
{
integer[ j ] = value % 10;
value /= 10;
}
}
HugeInteger HugeInteger::add( const HugeInteger &op2 )
{
HugeInteger temp;
int carry = 0;
for ( int i = 39; i >= 0; i-- ) {
temp.integer[ i ]=integer[ i ] + op2.integer[ i ] + carry;
if ( temp.integer[ i ] > 9 ){
temp.integer[ i ] %= 10; // reduce to 0-9
carry = 1;
} else{
carry = 0;
}
return temp;
}
void HugeInteger::output()
{
int i;
for ( i = 0; ( integer[ i ] == 0 ) && ( i <= 39 ); i++ );
if ( i == 40 )
cout << 0;
else
for ( ; i <= 39; i++ )
cout << integer[ i ];
}
HugeInteger HugeInteger::subtract( const HugeInteger &op2 )
{
HugeInteger temp;
int borrow = 0;
for ( int i = 39; i >= 0; i-- ){
if ( integer[i] < op2.integer[i] ){
temp.integer[ i ]=(integer[i]+10)-op2.integer[i]- borrow;
borrow = 1;
} else {
temp.integer[ i ]=integer[i] - op2.integer[ i ] - borrow;
borrow = 0;
}
}
return temp;
}
bool HugeInteger::isEqualTo( HugeInteger &x ){
return integer == x.getInteger();
}
bool HugeInteger::isNotEqualTo( HugeInteger &x )
{ return !( this->isEqualTo( x ) ); }
bool HugeInteger::isGreaterThan( HugeInteger &x )
{ return integer < x.getInteger(); }
bool HugeInteger::isLessThan( HugeInteger &x )
{ return integer > x.getInteger(); }
bool HugeInteger::isGreaterThanOrEqualTo( HugeInteger &x )
{ return integer <= x.getInteger(); }
bool HugeInteger::isLessThanOrEqualTo( HugeInteger &x )
{ return integer >= x.getInteger(); }
bool HugeInteger::isZero()
{ return ( getInteger() == 0 ); }
//main file
#include
using std::cout; using std::endl;
#include "hugeint1.h"
int main()
{
HugeInteger n1( 7654321 );
HugeInteger n2( 7891234 );
HugeInteger n3;
HugeInteger n4( 5 );
HugeInteger n5;
n5 = n1.add( n2 );
n1.output();
cout << " + "; n2.output();
cout << " = "; n5.output();
cout << "\n\n";
n5 = n2.subtract( n4 );
n2.output();
cout<< " - "; n4.output();
cout << " = "; n5.output();
cout << "\n\n";
if ( n1.isEqualTo( n1 ) == true )
{n1.output();cout << " is equal "; n1.output(); cout << "\n\n";}
if ( n1.isNotEqualTo( n2 ) == true )
{n1.output();cout << " is not equal to ";n2.output();cout << "\n\n";}
if ( n2.isGreaterThan( n1 ) == true )
{n2.output();cout << " is greater than ";n1.output();cout <<"\n\n";}
if ( n2.isLessThan( n4 ) == true )
{n4.output();cout << " is less than ";n2.output();cout << "\n\n";}
if( n4.isLessThanOrEqualTo( n4 ) == true )
{n4.output();cout << " is less than or equal to ";n4.output();
cout << "\n\n";}
if ( n3.isGreaterThanOrEqualTo( n3 ) == true )
{n3.output();cout << " is greater than or equal to ";n3.output();
cout << "\n\n";}
if ( n3.isZero() != true )
{cout << "n3 contains value ";n3.output();cout << "\n\n";}
return 0;
}
Explanation:
The HughInteger class is a C++ class created to instantiate a vector object of both negative and positive integer values. It has the aforementioned methods in the code above that is used to interact with the several vector objects created from the class.
List ways technology impacts other careers not discussed such as finance, government, and agriculture
The different ways in which technology impacts other careers not discussed such as finance, government, and agriculture
The Impact of Tech
Finance: Technology streamlines transactions, risk analysis, and financial planning. Artificial Intelligence models predict market trends, making investing more accurate.
Government: Digitization facilitates public services like tax payments, license renewals, and online voting. Big data aids in policy formulation and disaster management.
Agriculture: Precision farming technologies, like drones and IoT sensors, enhance crop productivity and sustainability. Advanced biotech accelerates the breeding of more resilient crops.
Medicine: Telemedicine and digital health records revolutionize patient care, while AI assists in diagnosis and treatment planning.
Education: E-learning platforms enable remote learning, while AR/VR creates immersive educational experiences.
Retail: E-commerce platforms, digital marketing, and AI-based customer behavior prediction are transforming shopping experiences.
Manufacturing: Automation and robotics improve efficiency and safety. Digital twin technology optimizes production processes.
Read more about technology here:
https://brainly.com/question/7788080
#SPJ1
Which tags should be bolded?
Explanation:
As per the nature and importance of the context the certain words can be bolded to make them prominent.
It also refers to the type of sentence either .
negative interrogative simple sentenceA computer has 32-bit virtual addresses and 4-KB pages. The program and data together fit in the lowest page (0–4095) The stack fits in the highest page.
1.How many entries are needed in the page table if traditional (one-level) paging is used?
2.How many page table entries are needed for two-level paging, with 10 bits in each part?
The numbers of entries needed is that:
For a one-level page table, one needs 232/212 or 1M pages needed. Note that the page table must have 1M entries. Can I run a 32-bit virtual machine using a 64-bit OS?Others are:
For two-level paging, the main page table must have 1K entries, each have to points to a second page table. Note that only two of these are to be used.Therefore, in full, only three page table entries are said to be needed, where one in the top-level table and another in each of the lower-level tables.
Note that one can install a 32-bit virtual machine in 64-bit Windows 10 system as it is very possible as long as the processor aids Virtualization Technology (VT).
Learn more about computer from
https://brainly.com/question/24540334
#SPJ1
QUESTION 6 Which of the following is a class A IPv4 address? a. 118.20.210.254 b. 183.16.17.30 c. 215.16.17.30 d. 255.255.0.0
Answer:
a. 118.20.210.254
Explanation:
Here are the few characteristics of Class A:
First bit of the first octet of class A is 0.
This class has 8 bits for network and 24 bits for hosts.
The default sub-net mask for class A IP address is 255.0.0.0
Lets see if the first bit of first octet of 118.20.210.254 address is 0.
118 in binary (8 bits) can be represented as : 1110110
To complete 8 bits add a 0 to the left.
01110110
First bit of the first octet of class A is 0 So this is class A address.
For option b the first octet is : 183 in the form of bits = 10110111 So it is not class A address
For option c the first octet is 215 in the form of bits = 11010111 So it is not class A address
For option d the first octet is 255 in the form of bits = 11111111. The first bit of first octet is not 0 so it is also not class A address.
what are the elements in a publication called
Answer:
There are several important elements in a magazine layout, such as headline, image, image caption, running head, byline, subhead, body copy, etc. Here, we look into the ten most crucial elements of a magazine layout.
Answer:
MARK AS BRAINLIEST ANSWERS
PLZ FOLLOW ME
Explanation:
There are several important elements in a magazine layout, such as headline, image, image caption, running head, byline, subhead, body copy, etc.
HOPE IT HELPS YOU
Declare and define a function called displayConcat that displays the concatenation of the first parameter with the second. Ex: displayConcat("After", "noon") displays "Afternoon".
xamine the following output:
Reply from 64.78.193.84: bytes=32 time=86ms TTL=115
Reply from 64.78.193.84: bytes=32 time=43ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=47ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=73ms TTL=115
Reply from 64.78.193.84: bytes=32 time=46ms TTL=115
Which of the following utilities produced this output?
The output provided appears to be from the "ping" utility.
How is this so?Ping is a network diagnostic tool used to test the connectivity between two network devices,typically using the Internet Control Message Protocol (ICMP).
In this case, the output shows the successful replies received from the IP address 64.78.193.84,along with the response time and time-to-live (TTL) value.
Ping is commonly used to troubleshoot network connectivity issues and measureround-trip times to a specific destination.
Learn more about utilities at:
https://brainly.com/question/30049978
#SPJ1
where do I go to ask help from a tech and internet expert. security and protection. I'm open to suggestions and guesses
Answer:
from my own experience, the best place to call is your local Best Buy store. they have a group of technicians called the Geek Squad, and you can either call them for tech support or protection suggestions, or have them do maintenance on a device (both in store and at home)
Which of the following would be considered unethical for a programmer to do? (5 points)
Create software used to protect users from identity theft
Ignore errors in programming code that could cause security issues
Protect users from unauthorized access to their personal information
Use someone else's code with the original developer's permission
One thing that would be onsidered unethical for a programmer to do is B. Ignore errors in programming code that could cause security issues
Why would this be unethical for a programmer ?Creating software designed to protect users from identity theft stands as a commendable and ethical endeavor, demonstrating the programmer's commitment to safeguarding user information and thwarting identity theft.
Engaging in such behavior would be considered unethical since it undermines the security and integrity of the software, potentially exposing users to vulnerabilities and compromising their sensitive data. Respecting intellectual property rights and obtaining proper authorization reflects adherence to ethical and legal standards.
Find out more on programmers at https://brainly.com/question/13341308
#SPJ1
Build an NFA that accepts strings over the digits 0-9 which do not contain 777 anywhere in the string.
To construct NFA that will accept strings over the digits 0-9 which do not contain the sequence "777" anywhere in the string we need the specific implementation of the NFA which will depend on the notation or tool used to represent NFAs, such as state diagrams or transition tables.
To build an NFA (Non-Deterministic Finite Automaton) that accepts strings over the digits 0-9 without containing the sequence "777" anywhere in the string, we can follow these steps:
Start by creating the initial state of the NFA.
Add transitions from the initial state to a set of states labeled with each digit from 0 to 9. These transitions represent the possibility of encountering any digit at the beginning of the string.
From each digit state, add transitions to the corresponding digit state for the next character in the string. This allows the NFA to read and accept any digit in the string.
Add transitions from each digit state to a separate state labeled "7" when encountering the digit 7. These transitions represent the possibility of encountering the first digit of the sequence "777".
From the "7" state, add transitions to another state labeled "77" when encountering another digit 7. This accounts for the second digit of the sequence "777".
From the "77" state, add transitions to a final state when encountering a third digit 7. This represents the completion of the sequence "777". The final state signifies that the string should not be accepted.
Finally, add transitions from all states to themselves for any other digit (0-6, 8, 9). This allows the NFA to continue reading the string without any constraints.
Ensure that the final state is non-accepting to reject strings that contain the sequence "777" anywhere in the string.
In conclusion, the constructed NFA will accept strings over the digits 0-9 that do not contain the sequence "777" anywhere in the string. The specific implementation of the NFA will depend on the notation or tool used to represent NFAs, such as state diagrams or transition tables.
For more such questions on NFA, click on:
https://brainly.com/question/30846815
#SPJ8
the part of the computer that contains the brain , or central processing unit , is also known the what ?
Answer:
system unit
Explanation:
A system unit is the part of a computer that contains the brain or central processing unit. The primary device such as central processing unit as contained in the system unit perform operations hence produces result for complex calculations.
The system unit also house other main components of a computer system like hard drive , CPU, motherboard and RAM. The major work that a computer is required to do or performed is carried out by the system unit. Other peripheral devices are the keyboard, monitor and mouse.
Which of the following statements is correct?
Select one:
a. A failure in Network layer crashes the application
b. A failure in Network layer affects transport layer
c. A failure in Network layer affects Data Link layer
d. A failure in Network layer affects entire communication
e. A failure in Network layer stops the device from working entirely
The statement which is correct from the given answer choices is:
C. A failure in Network layer affects Data Link layerAccording to the given question, we are asked to show which of the statement about the network layer is most represented accurately.
As a result of this, we can see that a network layer is a part of the OSI model which is in charge of receiving and forwarding service requests from the sender to the receiving host in a network.
With this in mind, if the network layer fails, then there would also be a failure in the data link layer.
Therefore, the correct answer is option C
Read more here:
https://brainly.com/question/21298343
Which of the following do you do to select text?
a
press CTRL+T
b click and drag across the desired text
000
C right-click and drag across the desired text
d press CTRL+S
To select text, the following can be done: a. Press CTRL+T b. Click and drag across the desired text c. Right-click and drag across the desired text d. Press CTRL+S.
The correct answer to the given question are options a, b, c and d.
The above options can be used in selecting text. The most common methods used for selecting text include clicking and dragging, double-clicking, and triple-clicking.
To select text by clicking and dragging, click at the beginning of the text, and drag to the end of the text while holding down the left mouse button. This method is useful for selecting large blocks of text. Double-clicking on a word selects that word, and triple-clicking on a paragraph selects the entire paragraph.
Alternatively, to select a sentence, double-click on the sentence.
Similarly, to select a paragraph, triple-click the paragraph. To highlight text by dragging the mouse pointer over it, left-click and hold at the beginning of the selection, drag the pointer across the text while still holding down the left mouse button, and then release the button when the selection is complete. The cursor changes to a pointer when it is moved over text.
For more such questions on select text, click on:
https://brainly.com/question/26940131
#SPJ8
Write the use of these computers.
Analog computer
Mainframe computer
Mini computer
Laptop computer
Desktop Computer
Answer:
i not know mainframe computer there is many use of computer
Answer:
There used for school, and googol
Explanation:
lol
some context free languages are undecidable
Any set of logic-gate types that can realize any logic function is called a complete set of logic gates. For example, 2-input AND gates, 2- input OR gates, and inverters are a complete set, because any logic function can be expressed as a sum of products of variables and their complements, and AND and OR gates with any number of inputs can be made from 2-input gates. Do 2-input NAND gates form a complete set of logic gates? Prove your answer.
Answer:
Explanation:
We can use the following method to solve the given problem.
The two input NAND gate logic expression is Y=(A*B)'
we can be able to make us of this function by using complete set AND, OR and NOT
we take one AND gate and one NOT gate
we are going to put the inputs to the AND gate it will give us the output = A*B
we collect the output from the AND and we put this as the input to the NOT gate
then we will get the output as = (A*B)' which is needed
For the Pie chart data labels, remove the Value labels
and edit the label options to display Percentage format at
the Center position, and then close the task pane.
Excel is a spreadsheet that features tools like graphs, tables, charts, calculations, etc. The label options are edited by the percentage tool in the excel sheet.
What are data labels?Data labels in an excel sheet are information of the data that provides information of the pie chart in the form of numbers and percentages as given in the instructed data.
To display the percentage format in the data label click the graph and select the green plus in the top right corner. Select more options and check the percentage box and uncheck the value labels. Now, check the "inside end" box to exit the settings.
Therefore, the value labels can be replaced by the percentage values in a pie chart.
Learn more about pie chart here:
https://brainly.com/question/15313963
#SPJ1
I lost the charger. How do I charge this camera without the charger?
Answer:
possibly a new battery????
Answer:
See below
Explanation:
This is from the manual for your camera:
(just plug the larger USB into a USB power source/brick/computer to charge the battery )
Project 12-2: Bird Counter
Help me make a Python program for birdwatchers that stores a list of birds along with a count of the
number of times each bird has been spotted.
Console
Bird Counter program
Enter 'x' to exit
Enter name of bird: red-tailed hawk
Enter name of bird: killdeer
Enter name of bird: snowy plover
Enter name of bird: western gull
Enter name of bird: killdeer
Enter name of bird: western gull
Enter name of bird: x
Name Count
=============== ===============
Killdeer 2
Red-Tailed Hawk 1
Snowy Plover 1
Western Gull 2
Specifications
Use a dictionary to store the list of sighted birds and the count of the number of times
each bird was sighted.
Use the pickle module to read the dictionary from a file when the program starts and
to write the dictionary to a file when the program ends. That way, the data that's
entered by the user isn't lost.
The program based on the information given is illustrated below.
How to illustrate the program?It should be noted that a computer program is a set of instructions in a programming language for the computer to execute.
Based on the information, the program is illustrated thus:
Code:
import pickle
#function to read birds data
def readBirdsData():
try:
birdsFile = open("birdsData","rb")
birdWatcher = pickle.load(birdsFile)
birdsFile.close()
birdWatcher ={}
except EOFError:
birdWatcher ={}
return birdWatcher
#function to write the data into file using pickle
def writeBirdsData(birdWatcher):
if birdWatcher == {} :
return
sorted(birdWatcher)
birdsFile = open("birdsData","ab")
pickle.dump(birdWatcher,birdsFile)
birdsFile.close()
#function to display birds data in sorted order
def displayBirdsData(birdWatcher):
print("Name\t\tCount")
print("========\t===========")
for key in sorted(birdWatcher.keys()):
print("{}\t\t{}".format(key,birdWatcher[key]))
#main function
def main():
birdWatcher = readBirdsData()
print("Bird Counter Program")
print ("\nEnter 'x' to exit\n")
name = input("Enter name of bird: ")
while True:
#break the loop if x is entered
if name == 'x':
#if the name exists in dictionary then increase the value
if the name in birdWatcher.keys():
birdWatcher[name] = birdWatcher[name] + 1
else:
#dd it otherwise
birdWatcher[name] = 1
name = input("Enter name of bird: ")
displayBirdsData(birdWatcher)
writeBirdsData(birdWatcher)
#driver code
if __nam__ == '__main__':
main()
Learn more about programs on:
https://brainly.com/question/26642771
#SPJ1
How has technology impacted the United States of America economically during
the pandemic?
Answer: it has helped with if you cannot travel you can still see friends and family by facetime or text
Explanation:
Answer:
People unable to work, shops shutting down, causes the economy to go down.
Explanation:
explain approaches of AI
Answer:
Main AI Approaches
There are three related concepts that have been frequently used in recent years: AI, machine learning, and deep learning.
Watch any film of the silent era. Choose a short film from any genre that is less than 30 minutes long. Write a review of your experience of watching this film. Make comparisons with a modern film of the same genre that you have recently watched.
A review of your experience of watching this film. Make comparisons with a modern film of the same genre that you have recently watched The Consistency of the Silent Era Technique in The Artist.
What have been a number of the principal silent movie genres?Many early silent movies have been both dramas, epics, romances, or comedies (frequently slapstick). One-reelers (10-12 minutes) quickly gave manner to four-reel feature-period movies.
From the factor of visible method seems there are a few which can be ordinary of the silent film technology this is appearing players, kind of shot, modifying transitions, intertitles and sound strategies together with using track at some stage in the movie.
Read more about the comparisons :
https://brainly.com/question/25261401
#SPJ1
First one who answers gets brainiest
Answer:
thank for the point anyway
Choose the type of malware that best matches each description.
to be triggered
:infects a computer or system, and then replicates itself, but acts independently and does not need
: tricks the user into allowing access to the system or computer, by posing as a different type of file
infects a computer or system, and then replicates itself after being triggered by the host
Answer:
B - tricks the user into allowing access to the system or computer, by posing as a different type of file
Answer:
Worm: infects a computer or system, and then replicates itself, but acts independently and does not need to be triggered
Trojan horse: tricks the user into allowing access to the system or computer, by posing as a different type of file
Virus: infects a computer or system, and then replicates itself after being triggered by the host
Explanation:
You have found a file named FunAppx86.exe on your hard drive. Which system(s) would this executable file MOST likely run on?
Since you have found a file named FunAppx86.exe on your hard drive, the systems that this executable file MOST likely run on is Both 32-bit and 64-bit systems.
What does 32- and 64-Bit Mean?When it comes to computers, the processing capability differential between a 32-bit and a 64-bit is everything. 64-bit processors are newer, quicker, and more secure than 32-bit processors, which are older, slower, and less secure.
Therefore, A computer file that contains an encoded sequence of instructions that the system can directly execute when the user clicks the file icon," is the definition of an executable file.
Learn more about executable file from
https://brainly.com/question/28146265
#SPJ1
Choose the appropriate computing generation.
: artificial intelligence
: integrated circuits
: microprocessors
: parallel processing
the awsers for them are 5th generation 3rd generation 4th generation i really need help guys
The appropriate computing generation for each of theese are:
Artificial intelligence is 5th generation
Integrated circuit is 3rd generation
Microprocessor are 4th generation
Parallel processors is 5th generation
What is a computing generation?
There are five computing generations, they are defined from the technology and components used: valves, transistors, integrated circuits, microprocessors and artificial intelligence, respectively.
Each generation of computers refers to a period when a technology with similar capabilities and characteristics is launched on the market and produced on a large scale.
Since the first tube computers, computers have preserved the same fundamental architecture: data processor, main memory, secondary memory and data input and output devices.
See more about computing at: brainly.com/question/20837448
#SPJ1
you have a computer named computer a running windows 10. you turn on system protection and create a restore point named point a. you perform the following changes:
If you restore Point A, the files File1.txt, File2.txt, and File3.sys are available, but the applications App1 and App2 are removed.
What is an application?An application, also known as an application programme or application software, is a piece of computer software that carries out a specific task either directly for the end user or, in some cases, for another application. A programme or group of programmes can be an application. A series of actions known as a programme allows a user to use an application.
The operating system (OS) of the computer and other auxiliary software, usually system software, are required for applications to run. Through an application programming interface, a programme communicates and requests services from other technologies (API).
Learn more about application
https://brainly.com/question/24264599
#SPJ4
Which of the following statements creates a constant in Java?
A.int const = 5;
B. const int x = 5;
C. final int x = 5;
D. const x = 5;
Answer: C
Explanation: C establishes a constant integer of 5 as x
what is output? x=-2 y=-3 print (x*y+2)
Answer:
=8
Aaaaaaaaaansjxjdjsaaaaaaa
Explanation:
-2*-3=6+2=8
what is a microscope
Answer:
an optical instrument used for viewing very small objects, such as mineral samples or animal or plant cells, typically magnified several hundred times
Answer:
A microscope is a laboratory instrument used to examine objects that are too small to be seen by the naked eyes.