you can use a minus sign to make a negative numberlike -2. What happens to each of the following 2++2
2 - -2
2+ - 2
2- +2

Answers

Answer 1
2 - -2 = 4
2 + -2 = 0
2 - +2 = 0
:)
Answer 2

If we use a minus sign to make a negative number like -2. Then the following terms will be:

2 - -2 = 42 + -2 = 02 - +2 = 0What is calculation?

A calculation is a methodical, well-thought-out process. Calculating the solution to a math problem is the first type of calculation, for which you might use a calculator. The calculation also includes applying logic to a non-numerical issue.

Plus, minus, multiply, and divide are the basic signs used in math to calculate problems. These signs also change when come n contact with each other, like plus and minus are equal to minus.

Like here, 2 - -2. Minus and minus is plus, so two plus two is four.

2 + -2 = 0, here plus minus = minus, so two minus two is 0.

Therefore, the calculation for the given is

2 - -2 = 42 + -2 = 02 - +2 = 0

To learn more about calculation, refer to the link:

https://brainly.com/question/14106833

#SPJ2


Related Questions

When an item is gray that means...
A. The item only works with another application
B. The item has been selected
C. The item is unavailable
D. The item has been deleted
A,B,C,orD, can anyone please help?

Answers

Answer:

B. The item has been selected

Answer:

C

Explanation:

When an item is unavailable, usually referring to the Technology field, it is gray. Gray items are things that are not created anymore, sold out or not enough supply. The color gray is usually used to symbol something bad, and not having a product is considered bad. Using our background knowledge, we can concude that the answer is option C.

Consider the following class, which uses the instance variable balance to represent a bank account balance.

public class BankAccount {

private double balance;


public double deposit(double amount) {

/* missing code */

}

}
The deposit method is intended to increase the account balance by the deposit amount and then return the updated balance. Which of the following code segments should replace /* missing code */ so that the deposit method will work as intended?
a.
amount = balance + amount;
return amount;
b.
balance = amount;
return amount;
c.
balance = amount;
return balance;
d.
balance = amount;, , return balance;,
balance = balance + amount;
return amount;
e.
balance = balance + amount;
return balance;

Answers

Answer:

e.

balance = balance + amount;

return balance;

Explanation:

Required

Code to update account balance and return the updated balance

The code that does this task is (e).

Assume the following:

[tex]balance = 5000; amount = 2000;[/tex]

So, code (e) is as follows:

balance = balance + amount; [tex]\to[/tex]

[tex]balance = 5000 + 2000[/tex] [tex]\to[/tex]

[tex]balance = 7000[/tex]

Here, the updated value of balance is 7000

So: return balance

will return 7000 as the updated account balance

Other options are incorrect

High-level modulation is used: when the intelligence signal is added to the carrier at the last possible point before the transmitting antenna. in high-power applications such as standard radio broadcasting. when the transmitter must be made as power efficient as possible. all of the above.

Answers

Answer:

Option d (all of the above) is the correct answer.

Explanation:

Such High-level modulation has been provided whenever the manipulation or modification of intensity would be performed to something like a radio-frequency amplifier.Throughout the very last phase of transmitting, this then generates an AM waveform having relatively high speeds or velocity.

Thus the above is the correct answer.

JavaAssignmentFirst, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "BackwardsStrings" (without the quotation marks) that:Prompts the user at the command line for one 3-character string.Then (after the user inputs that first 3-character string) prompts the user for another 3-character string.Then prints out the two input strings with a space between them.Finally prints on a separate line the two input strings 'in reverse' (see example below) with a space between them.So, for example, if the first string is 'usr' and the second string is 'bin', your program would output something like the following:The two strings you entered are: usr bin.The two strings in reverse are: nib rsu.Note that the reversed SECOND string comes FIRST when printing the strings in reverse.my result/*Name: Saima SultanaLab:PA - BackwardsStrings (Group 2)*/package backwardsstrings;import java.util.Scanner;public class BackwardsStrings { public static void main(String[] args) { //variables String first, second; // TODO code application logic here StringBuilder firstReversed= new StringBuilder(); StringBuilder secondReversed= new StringBuilder(); Scanner input = new Scanner(System.in); // read strings first=input.nextLine(); second=input.nextLine(); // print out the input strings System.out.println("The two string you entered are:"+ first+" "+second+"."); // reverse the strings for ( int i=first.length()-1;i>=0; i--) firstReversed.append(first.charAt(i)); for ( int i=second.length()-1;i>=0; i--) secondReversed.append(second.charAt(i));// print out the reverse string System.out.println("The two strings in reverse are:"+secondReversed+" "+ firstReversed+ ".");}}

Answers

Answer:

Your program would run without error if you declared the first and second string variables before using them:

Modify the following:

first=input.nextLine();  

second=input.nextLine();

to:

String first=input.nextLine();  

String second=input.nextLine();  

Explanation:

Required

Program to print two strings in forward and reversed order

The program you added is correct. The only thing that needs to be done is variable declarations (because variables that are not declared cannot be used).

So, you need to declared first and second as strings. This can be done as follows:

(1) Only declaration

String first, second;

(2) Declaration and inputs

String first=input.nextLine();  

String second=input.nextLine();  

The first PCI bus has a 32-bit data path, supplied 5 V of power to an adapter card, and operated at what frequency?
a. 88 MHz
b.64 MHz
c. 16 MHz
d. 33 MHz

Answers

Answer:

D. 33mhz

Explanation:

The PCI is short for peripheral component interconnect. This has speed and was made by Intel. At first it was made to be 32 bits and with a speed that 2as up to 33 megahertz. But other versions that followed had 64 bit and 66 megahertz.

This bus can stay with other buses and can work in synchronous or the asynchronous mode.

Which statement describes what happens when a user configures No Automatic Filtering in Junk Mail Options?
O No messages will ever be blocked from the user's mailbox.
O Messages can still be blocked at the server level
O Messages cannot be blocked at the network firewall
O Most obvious spam messages will still reach the client computer
ANSWER IM TIMED

Answers

Answer: Most obvious spam messages will still reach the client computer

Explanation:

It should be noted that by default, usually the junk email filter is already set to No Automatic Filtering.

When a user configures No Automatic Filtering in Junk Mail Options, it should be noted that most obvious spam messages will still reach the client computer.

Therefore, the correct option is D.

find the summation of even number between (2,n)​

Answers

Answer:

The program in python is as follows:

n = int(input("n: "))

sum = 0

for i in range(2,n+1):

   if i%2 == 0:

       sum+=i

print(sum)

Explanation:

This gets input n

n = int(input("n: "))

This initializes sum to 0

sum = 0

This iterates through n

for i in range(2,n+1):

This checks if current digit is even

   if i%2 == 0:

If yes, take the sum of the digit

       sum+=i

Print the calculated even sum

print(sum)

asdcvnmn bvcdxszasdfghjk.

Answers

Answer:

fewrugbrubpwerivrib

Explanation:

vbhresibvhresiupvkbjriururbvurfiuibvuefsbiuiuvuib

A Key Factor in Controlling Your Anger Is Using Passive behaviour.T/F

Answers

Answer:

The answer is "True".

Explanation:

Assertiveness means that others are encouraged to be open, honest about their thoughts, wishes and feelings so how they can act properly. Assertive behavior: be open and communicate wishes, ideas and feelings, as well as encourage others to do likewise. Please visit our Emotional Regulation page. A major aspect is the ability to control your anger. Once you are quiet or aggressive, work very hard.

evaluate (0.999)^8, to six places of decimal​

Answers

Answer:

Here is your answer 0.99202794407

Selecting missing puppies 1 # Select the dogs where Age is greater than 2 2 greater_than_2 = mpr [mpr. Age > 2] 3 print(greater_than_2) Let's return to our DataFrame of missing puppies, which is loaded as mpr. Let's select a few different rows to learn more about the other missing dogs. 5 # Select the dogs whose Status is equal to Still Missing 6 still_missing = mpr[mpr. Status == 'Still Missing'] 7 print (still_missing) Instructions 100 XP • Select the dogs where Age is greater than 2. 9 # Select all dogs whose Dog Breed is not equal to Poodle 10 not-poodle = mpr [mpr.Dog Breed != 'Poodle'] 11 print(not_poodle) • Select the dogs whose Status is equal to Still Missing. • Select all dogs whose Dog Breed is not equal to Poodle. Run Code Submit Answer * Take Hint (-30 XP) IPython Shell Slides Incorrect Submission Did you correctly define the variable not_poodle ? Expected something different. # Select all dogs whose Dog Breed is not equal to Poodle not_poodle = mpr[mpr.Dog Breed != 'Poodle'] print(not_poodle) File "", line 10 not_poodle = mpr [mpr.Dog Breed != 'Poodle'] Did you find this feedback helpful? ✓ Yes x No SyntaxError: invalid syntax

Answers

Answer:

# the dog dataframe has been loaded as mpr

# select the dogs where Age is greater than 2

greater_than_2 = mpr [mpr. age > 2]

print(greater_than_2)

# select the dogs whose status is equal to 'still missing'

still_missing = mpr[mpr. status == 'Still Missing']

print(still_missing)

# select all dogs whose dog breed is not equal to Poodle

not_poodle = mpr [mpr.breed != 'Poodle']

print(not_poodle)

Explanation:

The pandas dataframe is a tabular data structure that holds data in rows and columns like a spreadsheet. It is used for statistical data analysis and visualization.

The three program statements above use python conditional statements and operators to retrieve rows matching a given value or condition.

Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes grade, Midterm grade, Practical exam grade, and final exam grade) (each column is separated by $). You are required to write a C program to do the following:



• Using the concept of parallel arrays create records for students with above attributes (id, full name, score).(you are not allowed to use structure)

• Ask the user to enter the input file name and read it (suppose that, there are different files you could read data from). Read the data from the file and store it in record for students, which has IDs, Names, and Scores. The IDs should be declared as integers, the Names as a two-dimensional array of characters and the Scores as doubles. Assume that the maximum length of full name of any student is 50 characters. Also, you may assume that there will be No more than a 1000 student records in the file.

• Calculate the final grade as the flowing:

Grade= (Assignment)*15%+(Quizzes) *15%+(Midterm exam) *25%+(Practical Exam)

*10%+(Final) *35% Assuming that data in files are arranged in same order of the above equation with respect to grades



Hint: read form file, calculate the final score, and store it in the record before going to the next step.

• Display the following menu to the user and read the entered choice:

1) Sort data in ascending order according to students’ IDs and then display it.

2) Sort data in ascending order according to students’ names and then display it.

3) Sort data in descending order according to students’ scores and then display it.

Note: After running any of the above menus items, ask the user if he/she would like to save the current result, if so, prompt user to enter file name.

4) Ask the user to enter a student ID and display his score

5) Ask the user to enter a student name and display his score

6) Exit the program











 The program should keep displaying the menu until the user selects to exit from the program.

Implement each of the first five menu options as a separate function.

The attached file “data.txt” is for test.

Answers

Thank lord for you please

Use the drop-down menus to complete the steps for rearranging the layout of a form.

1. Open the form in
✔ Design
view.

2.
✔ Press Ctrl+A
to highlight all of the fields.

3. Under Form Design Tools, select the
✔ Arrange
tab.

4. Choose the Remove Layout button.

5. Reorder and arrange the layout as desired.

6. Review the changes in the
✔ Layout
view.

7. Click Save.

Just did it.

Answers

Answer:

1. Open the Form

2. Arrange tabs

3. Layout view

4. Reoder and arrange the Layout as desired

5. Press Ctrl + A

6. Choose the remove Layout button

7. Click Save

I am not sure

The complete steps for rearranging the layout of a form are in the order:

1, 2, 3, 4, 5, 6, and 7.

What is a form layout?

A form layout is the arrangement of all elements, components, and attributes of your form and the placement of the form on a specific page.

When rearranging the layout of the form, the steps to take are as follows:

Open the form in Design View (this means that the form needs adjustment and rearrangement.Press Ctrl+A (this control all function) helps to highlight all the features in the form layout fields.Under Form Design Tools, select the Arrange tab.Choose the Remove Layout button.Reorder and arrange the layout as desired.Review the changes in the Layout view.Click Save.

Learn more about form layout arrangement here:

https://brainly.com/question/9759966

#SPJ2

In Python, you can specify default arguments by assigning them a value in the function definition.

Answers

Answer:

use the input function to ask them their name like name = input(" enter name?: ") or

def greet(name, msg):

    # This function greets to  the person with the provided message

 print("Hello", name + ', ' + msg)  

greet("Andy", "Good morning!")

def greet(name, msg="Good morning!"):

   # This function greets to

     the person with the

     provided message.  

     If the message is not provided,

     it defaults to "Good

     morning!  

   print("Hello", name + ', ' + msg)

greet("Kate")

greet("Bruce", "How do you do?")

Explanation:

it's one of these three but not sure

Write a function called random_marks. random_marks should #take three parameters, all integers. It should return a #string. # #The first parameter represents how many apostrophes should #be in the string. The second parameter represents how many #quotation marks should be in the string. The third #parameter represen

Answers

Answer:

Explanation:

The following code is written in Java. It creates the function random_marks as requested. It uses three for loops to go concatenating the correct number of apostrophes, quotes, and pairs to the output string before returning it to the user. A test case was added in main and the output can be seen in the attached picture below.

class Brainly {

   public static void main(String[] args) {

       String output = random_marks(3,2,3);

       System.out.println(output);

   }

   public static String random_marks(int apostrophe, int quotes, int pairs) {

       String output = "";

       for (int x = 0; x < apostrophe; x++) {

           output += '\'';

       }

       for (int x = 0; x < quotes; x++) {

           output += '\"';

       }

       for (int x = 0; x < pairs; x++) {

           output += "\'\"";

       }

       return output;

   }

}

management is as old as human civilization. justify this statement​

Answers

Answer:

Indeed, management is as old as the human species, as human nature is itself dependent on the natural resources that it needs for its subsistence, therefore needing to exercise a correct administration of said resources in such a way as to guarantee that those resources can satisfy the greatest number of individuals. That is, the human, through the correct management of resources, seeks to avoid the scarcity of them.

The keyboard is used to select pictures on the computer.
#True# or False#​

Answers

We use the keyboard to type. it's false.

Answer:

False is the answer of your question

hope it is helpful to you

What are the basic characteristics of the linear structure in data structure

Answers

Explanation:

A Linear data structure have data elements arranged in sequential manner and each member element is connected to its previous and next element. This connection helps to traverse a linear data structure in a single level and in single run. Such data structures are easy to implement as computer memory is also sequential.

Write a class named Pet, with should have the following data attributes:1._name (for the name of a pet.2._animalType (for the type of animal that a pet is. Example, values are "Dog","Cat" and "Bird")3._age (for the pet's age)The Pet class should have an __init__method that creates these attributes. It should also have the following methods:-setName -This method assigns a value to the_name field-setAnimalType - This method assigns a value to the __animalType field-setAge -This method assigns a value to the __age field-getName -This method returns the value of the __name field-getAnimalType -This method returns the value of the __animalType field-getAge - This method returns the value of the __age fieldWrite a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This should be stored as the object's attributes. Use the object's accessor methods to retrieve the pet's name, type and age and display this data on the screen. Also add an __str__ method to the class that will print the attributes in a readable format. In the main part of the program, create two more pet objects, assign values to the attirbutes and print all three objects using the print statement.Note: This program must be written using Python language

Answers

Answer:

Explanation:

The following is written in Python, it contains all of the necessary object attributes and methods as requested and creates the three objects to be printed to the screen. The first uses user input and the other two are pre-built as requested. The output can be seen in the attached image below.

class Pet:

   _name = ''

   _animalType = ''

   _age = ''

   def __init__(self, name, age, animalType):

       self._name = name

       self._age = age

       self._animalType = animalType

   def setName(self, name):

       self._name = name

   def setAnimalType(self, animalType):

       self._animalType = animalType

   def setAge(self, age):

       self._age = age

   def getName(self):

       return self._name

   def getAnimalType(self):

       return self._animalType

   def getAge(self):

       return self._age

   def __str__(self):

       print("My Pet's name: " + str(self.getName()))

       print("My Pet's age: " + str(self.getAge()))

       print("My Pet's type: " + str(self.getAnimalType()))

name = input('Enter Pet Name: ')

age = input('Enter Pet Age: ')

type = input('Enter Pet Type: ')

pet1 = Pet(name, age, type)

pet1.__str__()

pet2 = Pet("Sparky", 6, 'collie')

pet3 = Pet('lucky', 4, 'ferret')

pet2.__str__()

pet3.__str__()

Horizontal Navigation List Styles
Go to the Horizontal Navigation List Styles section. Karen has added a second navigation list that she wants to display horizontally. For all list items within the horizontal navigation list, create a style rule that displays the items as blocks with a width of 12.5% floated on the left margin.
Here is my code:
/* Horizontal Navigation List Styles */
.horizontal li {
display: block;
width: 12.5%;
float: left;
}
It's coming through as just a line and I have no idea how to fix it, please help!

Answers

Answer:

Explanation:

The best way to do this would be to use the following line of code

clear: left;

This would make sure that there are no floating elements (li's in this scenario) on the left side of each element. Which in this navigation list would be each individual element, causing it to move each element underneath the previous element. Therefore the entire CSS code would be

.horizontal li {

   display: block;

   width: 12.5%;

   float: left;

   clear: left;

   }

An example can be seen in the attached picture below.

Which statement describes what happens when a user configures No Automatic Filtering in Junk Mail Options?
O No messages will ever be blocked from the user's mailbox.
Messages can still be blocked at the server level.
O Messages cannot be blocked at the network firewall.
O Most obvious spam messages will still reach the client computer,
PLEASE ANSWER CORRECTLY WILL GIVE 15pts

Answers

No messages will ever be blocked from the users mailbox. Messages can still be blacked at the sever level

A buffer is filled over a single input channel and emptied by a single channel with a capacity of 64 kbps. Measurements are taken in the steady state for this system with the following results:

Average packet waiting time in the buffer = 0.05 seconds
Average number of packets in residence = 1 packet
Average packet length = 1000 bits

The distributions of the arrival and service processes are unknown and cannot be assumed to be exponential.

Required:
What are the average arrival rate λ in units of packets/second and the average number of packets w waiting to be serviced in the buffer?

Answers

Answer:

a) 15.24 kbps

b) 762 bits

Explanation:

Using little law

a) Determine the average arrival rate (  λ  ) in units of packets/s

λ  = r / Tr  --- 1

where ; r = 1000 bits , Tr = Tw + Ts = 0.05 + (( 1000 / (64 * 1000 ))  = 0.0656

back to equation 1

λ = 1000 / 0.0656 = 15243.9 = 15.24 kbps

b) Determine average number of packets w to be served

w =  λ * Tw =  15243.9 * 0.05 = 762.195 ≈ 762 bits

what is the mean of "*" in wild card?​

Answers

Answer:

a playing card that can have any value,suit,color or other property in a game at the discretion of player holding it

plss. give me briniest ty.

A practice in which eavesdroppers drive by buildings or park outside and try to intercept wireless network traffic is referred to as: Group of answer choices cybervandalism. driveby downloading. war driving. sniffing. driveby tapping.

Answers

Answer:

war driving.

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, etc.

Generally, the two (2) essential privacy concerns in the field of cybersecurity are knowing how personal data are collected and essentially how they're used by the beneficiaries or end users.

War driving can be defined as a form of cyber attack which typically involves having eavesdroppers in a moving vehicle drive by buildings or park outside so as to avail them the opportunity of intercepting a wireless network traffic using a smartphone or laptop computer and illegitimately obtain sensitive user informations for further unauthorized use or to perform other fraudulent activities.

Write a program that accepts a date in the form month/day/year and outputs whether or not the date is valid. For example, 5/24/1962 is valid, but 9/31/2000 is not. (September has only 30 days.)

Answers

Answer:

Here is the code.

Explanation:

#include <stdlib.h>

#include <stdio.h>

int check_month(int month);

int check_date(int year, int month, int day);

void display_date(int year, int month, int day);

int check_year(int year);

int main (void)

{

int year, month, day;

int valid;

printf("\t\t\t\tEnter Date \n");

printf("\nyear (yyyy): ");

scanf("%d",&year);

printf("month: ");

scanf("%d",&month);

printf("day: ");

scanf("%d", &day);

valid = check_month(month);

if (valid)

{

valid = check_date(year, month, day);

}

if (valid)

{

display_date(year, month, day);

printf("is a valid date. \n");

}

else

{

display_date(year, month, day);

printf("is a illegal date. \n");

}

system ("pause");

return 0;

}

int check_month(int month)

{

int flag;

if (month>=1 && month<=12)

flag = 1;

else

flag = 0;

return flag;

}

int check_date(int year, int month, int day)

{

int valid;

int leep_year;

switch (month)

{

case 1:

case 3:

case 5:

case 7:

case 8:

case 10:

case 12:

if (day>=1 && day<=31)

valid = 1;

else

valid = 0;

break;

case 2:

leep_year = check_year(year);

if (leep_year)

{ if (day>=1 && day<=29)

valid = 1;

else

valid = 0;

}

else

{ if (day>=1 && day<=28)

valid = 1;

else

valid = 0;

}

break;

case 4:

case 6:

case 9:

case 11:

if (day>=1 && day<=30)

valid = 1;

else

valid = 0;

break;

}

return valid;

}

int check_year(int year)

{

int leep_year;

if (year%4==0)

{

if (year%100==0)

{

if (year%400==0)

leep_year = 1; // 1600, 2000

else

leep_year = 0; // 1700, 1800, 1900, 2100

}

else

{

leep_year = 1; // 2004, 1996

}

}

else

{

leep_year = 0; // 2003, 2011

}

return leep_year;

}

void display_date(int year, int month, int day)

{

if (month == 1)

printf("January");

else if (month == 2)

printf("February");

else if (month == 3)

printf("March");

else if (month == 4)

printf("April");

else if (month == 5)

printf("May");

else if (month == 6)

printf("June");

else if (month == 7)

printf("July");

else if (month == 8)

printf("August");

else if (month == 9)

printf("September");

else if (month == 10)

printf("October");

else if (month == 11)

printf("November");

else if (month == 12)

printf("December");

else

printf("The Month enter is not valid.\n");

printf(" %d, %d ",day,year);

}

how can you reduce the size of icons on the Taskbar by using the control panel is there another method of doing the same using right click explain​

Answers

Answer:

Right-click on any empty area of the taskbar and click “Taskbar Settings.” In the settings window, turn on the “Use small taskbar icons” option. As you can see, almost everything is the same except that the icons are smaller and you can cram a few more into the space.

What are TWO examples of soft skills?
computer programming
o responsibility
certification
communication
troubleshooting

Answers

Computer programming and throubleshooting

Suppose that in a 00-11 knapsack problem, the order of the items when sorted by increasing weight is the same as their order when sorted by decreasing value. Give an efficient algorithm to find an optimal solution to this variant of the knapsack problem, and argue that your algorithm is correct.

Answers

Answer:

Following are the response to the given question:

Explanation:

The glamorous objective is to examine the items (as being the most valuable and "cheapest" items are chosen) while no item is selectable - in other words, the loading can be reached.

Assume that such a strategy also isn't optimum, this is that there is the set of items not including one of the selfish strategy items (say, i-th item), but instead a heavy, less valuable item j, with j > i and is optimal.

As [tex]W_i < w_j[/tex], the i-th item may be substituted by the j-th item, as well as the overall load is still sustainable. Moreover, because [tex]v_i>v_j[/tex] and this strategy is better, our total profit has dropped. Contradiction.

explain about primary memory?​

Answers

Answer:

Primary memory is computer memory that a processor or computer accesses first or directly. It allows a processor to access running execution applications and services that are temporarily stored in a specific memory location. Primary memory is also known as primary storage or main memory.

Explanation:

NO LINKS
Write a C++ program to accept a 5 digit integer and to validate the input based on the following rules.

Rules

1) The input number is divisible by 2. 2) The sum of the first two digits is less than last two digits. if the input number satisfies all the rules, the system prints valid and invalid, otherwise,

Example 1:

Enter a value: 11222

Output: Input number is valid

Example 2:

Enter a value: 1234

Output: Input number is invalid​

Answers

Answer:

#include <iostream>

#include <string>

#include <regex>

using namespace std;

int main()

{

   cout << "Enter a 5-digit number: ";

   string number;

   cin >> number;

   bool valid = regex_search(number, regex("^\\d{4}[02468]$"));

   if (valid) {

       valid = stoi(number.substr(0, 1)) + stoi(number.substr(1, 1))  

           < stoi(number.substr(3, 1)) + stoi(number.substr(4, 1));

   }

   cout << number << (valid ? " is valid" : " is invalid");

}

Explanation:

Regular expressions can do all of your checking except for the sum of digits check. The checks are i.m.o. easiest if you don't treat the input as a number, but as a string with digits in it.

The regex means:

^ start of string

\d{4} exactly 4 digits

[02468] one of 0, 2, 4, 6 or 8 (this is what makes it even)

$ end of string

Other Questions
How many 1/3 servings are in 36 servings? Que elementos consideras que debe tener una politica monetaria para q no se perjudique tanto a las personas A product needs to be processed on both Resource X and Resource Y. There is only one of each of these resources and your goal is to meet market demand, which is 20 units per day and a day has 12 hours of working time. It takes 30 minutes to process a unit on Resource X and 15 minutes on Resource Y. If Resource X feeds Resource Y and both resources are scheduled to work 12 hours per day and process items just-in-case, then which Of the following statement is correct: a. There would be no accumulation of work-in-process inventory. b. Work-in-process inventory would accumulate in-front-of Resource Y. c. There would be no accumulation of finished goods inventory. You collect the following data for explanatory variable A and response variable B:A(x) B(y)1 14.22 14.93 15.54 16.85 17.86 18.97 20.18 20.99 21.510 22You calculate the following summary statistics: x-bar = 5.5, s subscript x = 3.03, y-bar = 18.26, s subscript y = 2.85, and r = .995.Required:What's the critical t value you'd use for a 95% confidence interval for the slope of this regression line? simplify the complex fraction. Which table represents exponential growth? Kwame and Ama shared an amount of money in the ratio 5:4 respectively. If Kwame had GHC 9.00, how much did they share? science the imaginary lines which divide the earth into areas of 15 are called Answer my this question too plsss 2) Find the remainder when x3 + x2 - 20 is divided by(x + 2) by using remainder theorem.{ANS: R = -24} Help me please with this question Help please this question is so hard! Complete each sentence regarding the bones of the lower extremity. Then place the sentences in order, based on the bones, from proximal to distal . tarsals 15 146humerus5patellafemurphalangestibia78fibulametatarsalsi. There are 2 bones in the lower leg. The________ is more medial, and the________ is more lateral ii. There are________ small bones of the toes that are called the__________ iii. There are ________irregular shaped bones in the foot known as the _________iv. The ________is also known knee cap v. There are __________small, long bones found in the top of the foot called _________vi. The __________is found in the thigh . Pat bought 6 shirts that were all the same price. He used a traveler'scheck for $25, and then paid the difference of $86. What was theprice of each shirt? What is the cube root of 216x^9y^18 ?A: 4x^3y^6B: 6x^3y^6C: 72x^6y^15D: 213x^6y^15 According to Mary Kaldor, one of the key differences between the guerrilla tactics used by revolutionaries and the tactics used by new warriors is the means by which they seek to control territory. In contrast to regular military tactics, revolutionaries attempt to gain control of territory using popular ideologies to gain local support. The new warriors are different in that they borrow their tactics from government counter insurgency units. True or False Which type of engineer specializes in the identification of mineral-rich deposit areas?geological engineersocean engineersaerospace engineersmining engineers You are the public relations director of a nonprofit hospital in a competitive market in a midsized city located in a metro area of 350,000 people. It is sweeps week for broadcast media. One of the stations is running a series on HIV/AIDS in the community. Recent segments have included those listed below.Homelessness related to HIV/AIDSHow persons living with HIV/AIDS suffer from being outcastsHow understanding has increased in some circles but prejudice remains in many.An appealing case of a hemophiliac who acquired HIV/AIDS through transfusion at the university hospital has been reported in the series. The university and its teaching hospital are located elsewhere in the state.At a staff meeting this morning, you learn that petitions are circulating in the community to request your hospital to convert its former nurses residence into a clinic and residential shelter for HIV/AIDS patients.The hospital no longer maintains a school of nursing. The three-story brick building has been used for miscellaneous administrative purposes since nurses training was phased out. The residence is connected to the hospital by an elevated corridor, similar to a skywalk. It does not have facilities for food service or laundry. Nurses always ate at the hospital and the hospital handled their laundry. The residence and hospital are served by common systems for hot water, steam heat, ventilating and sewer. The building predates central air conditioning.The human resources director reports that the business agent for kitchen and laundry workers, who are represented by a union, has already made informal contacts about this proposal, suggesting that grievances will result, at the very least, and a strike could ensue.Your director of volunteers expresses concern about reaction of volunteers who now handle many peripheral duties. Your physical plant supervisor, who lives in the neighborhood, says neighbors are already anxious over the possibility of HIV/AIDS patients in their vicinity. Your hospitals five-year Strategic Plan, which was recently updated, has no mention of developing an HIV/AIDS specialty.Write a letter (using your own name) to the hospital CEO, John Dolman and the Board of Governors outlining your plan to resolve this issue. Remember, that your letter will be made public to the other audiences and publics. In your recommendations, you should provide both long and short-term strategies that would solve this problem. To solve this problem you should note if additional resources or expenditures would be need to achieve the goals that you define.When writing the letter you should provide a brief description of the problems, you have found. What are the facts about major issues? Identify facts about key players in the case, the business problem(s) and then rank order the critical issues. Consider relevant information and underlying assumptions. Finally provide your recommendations.As you write your recommendations, think about the following;a. How do the cultural values at the hospital relate to communication, technology, information flow and openness?b. As the hospital goes forward, should it stick to the espoused culture or should it change? How would you recommend that they change?c. How would you suggest that they resolve this disparity? In other words what should they do?d. Provide specific suggestions that will help the organization as they go forward.e. In the closing, highlight benefits of your recommendations. As a PR director, you need to be honest but tactful in your recommendations Most of earths water______. 9. Reads lines 22 through 24 of the poem, Joan Benoit.and she was still freshand not even out of breathand standingHow do these lines develop a central idea?A.They mark a transition.B.They introduce an example.C.They contribute to the setting.D.They provide evidence for a claim.