1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PIT_PIT [208]
3 years ago
5

2. Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on

enumeration types to determine what incorrect or just silly things are legal. Now, write a C program that does the same things and run it to determine how many of the incorrect or silly things are legal. Compare your results.

Computers and Technology
1 answer:
erastovalidia [21]3 years ago
6 0

Answer:

Check the explanation

Explanation:

To solve the question above, we will be doing some arithmetic and bit wise operations on enum values. in addition to that, we are asserting the array with INTCOUNT  and also printing the size of array i.e 12 and we are adding BIG_COUNT enum value to 5 and the result is 25.

#include<stdio.h>

enum EnumBits

{

ONE = 1,

TWO = 2,

FOUR = 4,

EIGHT = 8

};

enum Randoms

{

BIG_COUNT = 20,

INTCOUNT = 3

};

int main()

{

// Basic Mathimatical operations

printf("%d\n",(ONE + TWO)); //addition

printf("%d\n",(FOUR - TWO)); //subtraction

printf("%d\n",(TWO * EIGHT)); //multiplication

printf("%d\n",(EIGHT / TWO)); //division

// Some bitwise operations

printf("%d\n",(ONE | TWO)); //bitwise OR

printf("%d\n",(TWO & FOUR)); //bitwise AND

printf("%d\n",(TWO ^ EIGHT)); //bitwise XOR

printf("%d\n",(EIGHT << 1)); //left shift operator

printf("%d\n",(EIGHT >> 1)); //right shift operator

// Initialize an array based upon an enum value

int intArray[INTCOUNT]; // declaring array

// Have a value initialized be initialized to a static value plus

int someVal = 5 + BIG_COUNT; //adding constant and BIG_COUNT variable

printf("%d\n",someVal); //value will be 25

printf("%d",sizeof(intArray)); //value will be 12

return 0;

}

Kindly check the attached image below for the Code and Output Screenshots:

You might be interested in
Help ASAP please ?
mylen [45]
Okay, so since I don't completely understand your question, I'll just try my best to explain each of them.

1. Someone can find your location based on a photo that you posted; If you tagged the location, obviously they can find the location. If you put in the caption where you were when you took the photo, again yes, they would be able to find the location. If you were in a well known location when you took the picture and you can clearly see the background or the setting, with context clues you can figure it out, but as far as the social media platform telling the public where the picture was taken or posted, it is not authorized to give out the location.

2. Colleges use social media during the admission process; Some colleges do check the social media, not all but some. Mostly the platforms where you are most careless, so watch out. You can decide if you want your account to be public or private in the account settings.

3. items posted online can be removed at anytime; yes it can be removed, but depending on how popular the post was, people will still remember it.

4. Things you post online become public information; yes and no. On any and all social media platforms, there is a setting where you can choose the audiences the post reaches. There is the public setting where it's completely public and out into the world, there is the privacy setting where you are the only one who can view it, there is the friends setting where your friends can view your posts, and on some there are the friends/followers except... where you can choose specific people that can't view your post/s, and finally there is the specific friends that can view the post. You can also decide if you want your account in general to be public or private, which you can go into the settings and decide.

5. Employers screen job candidates based on social medias; like number 2 up there, some employers do check your social medias, but if you have you account settings as private they will have to request access.

I hope I helped at least a little! If I didn't i'm sorry i didn't completely understand the question so I tried my best.
If I did help, I'd appreciate it if you would give me brainliest! Thank you!
5 0
3 years ago
Read 2 more answers
James is an intern in a film production company. On his first day, James’ boss, Monica, tells him, “Before anything else, let me
bija089 [108]

Answer:

cinematography is the answer broodaaa

6 0
3 years ago
A ____________would be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas a_____________
seraphim [82]

Answer:

The answer to this question is vulnerability and risk.

Explanation:

Vulnerability is there us misconfiguration in the system  and we know that our system is vulnerable means the hacker can gain unauthorized access to our system.

Risk is when there are chances that a misconfiguration  might happen in our system in future so that hacker could gain unauthorized access to the system.

7 0
3 years ago
The discipline focused on the production of software, as well as the development of tools, methodologies, and theories supportin
lara [203]

Answer:

Software Engineering.

Explanation:

Software engineering :- It is the branch of engineering which mainly focuses on the development,design and maintenance of the software.

It also deals with the developing the tools,theories ,methodologies supporting software production.

It is one of the most popular branches of engineering nowadays and also software engineers are one of the highly paid employees in a company.

8 0
3 years ago
I need help with this. It's while loops in python.
CaHeK987 [17]

Answer:

Here is a simple application running loop example in python

running = true

while(running):

# YOUR CODE HERE

Explanation:

A while loop is basically a loop of something if something is true

so if there is a boolean set to true for a application to run then use a while loop. Have a nice day! :)

4 0
3 years ago
Other questions:
  • Explain what might happen if two stations are accidentally assigned the same hardware address?
    15·1 answer
  • What is the name of small programs stored on the hard drive that tell the computer how to communicate with a specific hardware d
    5·1 answer
  • Why is it important to use correct posture while typing
    7·1 answer
  • BRAINLYEST IF CORRECT!!! What is the special feature of the View Side by Side command?
    6·2 answers
  • As a chemical engineer, what would you be most likely to do in your job?
    15·1 answer
  • TRUE OR FALSE! A query can have no more than three common interpretations.
    10·1 answer
  • A network resource is masquerading as a network server and is causing hosts on the network to send requests to the attacker rath
    11·1 answer
  • To calculate perimeter of a rectangle​
    9·2 answers
  • What would be the printed output of the Python code to the right?
    14·1 answer
  • What are the features of boot sector virus​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!