Answer:
Line 8 gives a compiller Error
Explanation:
In line 8, the statement: if (number >= 0 && <= 100) will give a compiller error because when using the logical and (&&) It is required to state the same variable at both sides of the operator. The correct statement would be
if (number >= 0 && number <= 100). The complete corrected code is given below and it will display the output "passed"
#include <iostream>
using namespace std;
int main()
{
int number = 5;
if (number >= 0 && number <= 100)
cout << "passed.\n";
else
cout << "failed.\n";
return 0;
}
Which statement is true regarding security for a computer that boots to Apple Mac OS X and then runs a Windows virtual machine
Answer:
The correct answer to the following question will be "Virtual windows PC needs the security of its own".
Explanation:
Using Parallels Desktop, Virtual box or the VMware Fusion to run Windows on a VM (virtual machine) inside the macOS. This technique allows the simultaneous running of Windows and mac programs, although the virtual machine doesn't quite accept as many Windows features as a double-boot configuration.Therefore, this will be the right answer.
Write a Python program that requests the price and weight of an item in pounds and ounces, and then determines the price per ounce from the below inputEnter price of item: 25.50Enter weight of item inpounds and ounces separately.Enter pounds: 1Enter ounces: 9Price per ounce: $1.02
Answer:
The program to this question as follows:
Program:
price=float(input('Enter total price: ')) #define variable price and take user-input
print('Enter value of weight separately into pounds and onces: ') #print message
pounds=int(input('Input pounds value: ')) # defining variable pounds and take user-input
ounces=int(input('Input ounces value: ')) # defining variable ounces and take user-input
total_ounces=pounds*16+ounces # defining variable total_ounces and calculate variable
total=price/total_ounces # defining variable total and calculate price/ounces
print('price/ounces is: ',total) #print value
Output:
Enter total price: 25.50
Enter value of weight separately into pounds and onces:
Input pounds value: 1
Input ounces value: 9
price/ounces is: 1.02
Explanation:
In the above python program code, a variable "price" is defined, that is takes price value from user, to take this value the "input and float" is used, in which the "float" convert value into decimal and input function is used for user- input.
In the next line, the print function is declared, which is used for print message and variable values, in this function, we print a message that takes two values separately. Then two-variable "pounds and ounces" are defined that take integer value separately.In the last step, the total_ounces variable is defined, which calculates total ounces and the total variable will use to calculate the price per ounces. The print function is used to print this variable value.
Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records associated to their Account or Contact record. The Architect is planning to use a Sharing Set to provide access to the records. When setting up the Sharing Set, certain objects are not available in the list of Available objects.Which two reasons explain why an object is excluded from the list of Available objects in a Sharing Set?Choose 2 answers
A. The custom object does not have a lookup to Accounts or ContactsB. The object’s Organization-Wide sharing setting is set to PrivateC. The object’s Organization-Wide setting is set to Public Read/WriteD. The object is a custom object, and therefore not available for a sharing set
Answer:
The answers are A and C
Explanation:
The reason the objects were excluded from the list of available objects are as follows:
A.) The custom object does not have a lookup to Accounts or Contacts
C.) The object's Organization-Wide sharing setting is set to Public Read/Write.
g Returns the contents of the list as a new array, with elements in the same order they appear in the list. The length of the array produced must be the same as the size of the list.
Answer:
Find the attached picture
Explanation:
Attached picture contains the Python function which takes a list as argument and returns a new list with same size and elements in same order.
Create a step-by-step IT security policy for handling user accounts/rights for a student who is leaving prematurely (drops, is expelled, and so on).
You will need to consider specialized student scenarios, such as a student who works as an assistant to a faculty member or as a lab assistant in a computer lab and may have access to resources most students do not.
Answer:
Step 1
IT security policies for handling user accounts or rights for a student
IT security is simply protecting computer systems from being robbed or damaged in terms of
Misdirection for service they produce Software'sHardware andinformationStep 2:
Account/Right is one of the security policies IT provides.Policies that can be written for handling user accounts includes
User account must reside within the system authorized by IT teamUser account protection User account responsibility User account and their access must agree to condition of usage established by IT.Policies for students who are leaving prematurely:
Expiry and deletion of user account:
When a course is finished or when a particular student withdraws from the course then user account gets terminated or deleted automatically.Achieving this can be through changes in authorization or deleting the account itself if no privileges are on the account
Step 4
Responsibilities of user account
A working assistant for the faculties who is a student would be given extra privileges compared to a normal student.For these category of students while exiting from the university they should hand over the responsibility , user account and password to the authority as required.
The access to other servers within the intranet or other resources are terminated.
Step 5
Privilege user account:
When assistant who are students drop out of a course,they should temporarily handover their user account to the concerned office.Now when they rejoin the the faculty he or she has the ability to take up the responsibility for handling the user's account
Step 6
Protection of user account
Assistants who are students or normal students ,while leaving at any time or for any reason should not relate their login ID's and password.IT polices do not request for user ID's under any circumstance.Hence it is he job of the student to maintain secrecy of their login ID and their password.
Explanation:
The above answer is an outline of an IT policy in order gain an insight on it let first define the term IT policy
IT policy
An IT policy can be defined as a lay down rule or a course of action adopted by an IT organisation to guild their activities in order to arrive at a particular outcome.this policies are implemented as a procedure or a protocol.
Some of the function of an IT policy include
1 To make available an IT infrastructure that would help the user identify opportunities , improve performance and understand business environment.
2 To evolve and archive information as corporate resource and to offer infrastructure to ensure coherent access for user to complete, concise and timely information.
The above answer provides a student with the necessary information to be able to make use of the resource on the faculties network.and be guided on outcome of some situation and conditions
Final answer:
To manage the IT security for user accounts of departing students with special access, one should follow a strict protocol involving notification, access review, revocation of rights, audits, documentation, continuity planning, and regular policy updates.
Explanation:
Step-by-Step IT Security Policy for Handling User Accounts/Rights
When a student who has been granted special access to certain resources (such as a faculty assistant or a lab assistant) leaves a college or university prematurely, it is crucial to follow a structured approach to revoke their access and secure the institution's systems. Here is a detailed step-by-step IT security policy to handle such scenarios:
Audit: Perform further audits on systems and services that were accessible to the student to ensure no security breaches or data manipulations.
Continuity Planning: Assess the need for a replacement or redistribution of the student's previous responsibilities to ensure continuity.
Policy Review and Update: Regularly review and update the IT security policy to incorporate new challenges and technologies.
Ensuring that explicit rules like the ones contained within a Student Handbook are diligently enforced is vital for maintaining the integrity of the institution's IT infrastructure, particularly when dealing with cyberbullying, identity theft, and other emerging issues.
Write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as well as the number of boxes needed to yield one metric ton of cereal. In: A metric ton is 35,273.92 ounces.
Answer:
The C++ code is given below
Explanation:
#include <iostream>
using namespace std;
int main () {
int flag=1;
do{
double ounce,metric,boxes;
cout<<"Enter weight of package in ounces: ";
cin>>ounce;
metric=ounce/35273.92;
cout<<"Metric ton is "<<metric<<endl;
boxes=35273.92/ounce;
cout<<"Number of boxes are: "<<boxes<<endl;
cout<<"Press 0 to quit else press 1: ";
cin>>flag;
}while(flag==1);
return 0;
}
If a computer is capable only of manipulating and storing integers, what difficulties present themselves? How are these difficulties overcome?
Final answer:
When a computer is only capable of manipulating integers, difficulties arise with decimal numbers. However, these difficulties can be overcome by using different data types and algorithms. Programming languages and libraries provide tools to handle decimal numbers accurately.
Explanation:
When a computer is only capable of manipulating and storing integers, difficulties arise when working with numbers that involve decimal points or fractions. This is because computers work with binary numbers, which only consist of the digits 0 and 1. Decimal numbers cannot be represented directly in binary notation.
However, these difficulties can be overcome by using different data types and algorithms. For example, floating-point numbers can be used to represent decimal numbers in a binary format. Algorithms can be developed to perform mathematical operations on these floating-point numbers, allowing computers to work with a wider range of numeric values.
Programming languages and libraries provide built-in functions and methods to handle decimal numbers and perform arithmetic operations accurately. By using these tools, computer programmers can effectively work with integers, as well as decimal numbers, without losing accuracy.
When writing functions that accept multi-dimensional arrays as arguments, ________ must be explicitly stated in the parameter list.
Answer:
size of all dimensions but the first.
Explanation:
This is because of a certain thing known as addressing. Compiler, in order to access any data, needs to know its address in memory.
If we don't pass in the value for any dimension after the first, compiler can't calculate the address of given array location we may want to access inside a function.
E.g.
void Foo(int bar[][3]) {
bar[1][2];
}
In the above example, the compiler needs to know the no. of columns in "bar" array to figure out the address of bar[1][2] and access the data underneath.
Because, in order to go to 2nd row in the array, compiler needs to know how much memory allocation (columns) is in a row.
What common problems do a collection of spreadsheets created by end users share with the typical file system?
Answer:
Explanation:
A spreadsheet is an application software to administrate data and different information, while in a file system we could find assignment table like FAT and NTFS, for example, FAT (file allocation table) is similar because store the data in tables, these methods have other things in common like hard to develop, difficult to get an answer, complex administration, and poor security.
Using your text editor, write the function sumSquares(aList). The function takes a list as an input and returns (not prints) the sum of the squares of the all the numbers which absolute value is divisible by 3. If an element in the list is not a number, the function should ignore the value and continue. When the function receives an input that is not a list, code should return the keyword None (not the string ‘None’). Hints: review the type() or isinstance() methods
Answer:
We have the Python code below with appropriate comments
Explanation:
#defining the function for use
def sumSquares(aList):
#checking if element in list is not in number as an error
if type(aList) is not list:
return 'error'
sum = 0
for x in aList:
#checking if in list and is
#divisible by 3
if type(x) in [int, float] and x % 3 == 0:
#squares of number x is x*x
#+= is an updating syntax that represents
#the sum of the squares
sum += x*x
#returning the sum, not printing
return sum
Sample test cases
print(sumSquares(5))
print(sumSquares('5'))
print(sumSquares(6.15))
print(sumSquares([1, 5, -3, 5, 9, 8, 4]))
print(sumSquares(['3', 5, -3, 5, 9.0, 8, 4, 'Hello']))
NOTE: Use in your code and view the result
Given the following function definition:
What is the output of the following code fragment that invokes calc?
1 2 3 1 6 3 3 6 3 1 14 9
None of these
The question is incomplete! Complete question along with its step by step answer is provided below!
Question:
Given the following function definition:
void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
x = 1;
y = 2;
z = 3;
calc(x, y);
cout << x << " " << y << " " << z << endl;
What is the output of the following code fragment that invokes calc?
a. 1 2 3
b. 1 6 3
c. 3 6 3
d. 1 14 9
e. None of these
Answer:
b. 1 6 3
Explanation:
In the given problem we have a function void calc which takes two input arguments a and b and updates its values according to following equations
c = a + 2;
a = a * 3;
b = c + a;
Then we call this function calc(x,y) by providing test values of
int x = 1;
int y = 2;
int z = 3;
and the output returns the values of x, y and z
cout << x << " " << y << " " << z << endl;
Lets find out what is happening here!
When the program runs we provide x=a=1 and y=b=2
c=a+2=1+2=3
a=a*3=1*3=3
b=c+a=3+3=6
So the updated values of a=x=3 and b=y=6?
NO!
The updated values are a=x=1 and b=y=6
WHY?
There are two ways to pass values
1. Pass by values -> value cannot change (int a)
2. Pass by reference -> value can change (int& b)
Look at the function void calc (int a, int& b) ;
Here we are passing (int a) as a value and (int& b) as a reference, therefore x remains same x=1 and y gets changed to updated value y=6 and z remains same as z=3 since it wasnt used by function calc(x,y)
The right answer is:
b. 1 6 3
x=1, y=6, z=3
Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full sentence string with the following content and format: Your name is [name] and you live in [city], [state].
Answer:
Below are the function for the above question in java Language---
void show_info(String name,String home,String state)
{
System.out.println("Your name is "+name+" and you live in "+ home+" ,"+state +".");
}
Output:
If the user inputs name="Gaus",city="LosAngeles" and state="California" then the output will be "Your name is Gaus and you live in LosAngeless, California."Explanation:
The above function is in java language which takes three argument names, state, and the city.The name will be stored on the name variable of the string type.The state will be stored on the state variable of string type.The city will be stored on the city variable of the string type.Then the Output will be displayed with the help of the print function.'+' is used to merge the string.1. Write an LMC (Little Man Computer) program to do the following task. if (value == 0) { some_statements; } next_statement;
2. Write an LMC program to add three numbers. The numbers are provided in the in-basket. The sum of the numbers should appear in the out-basket.
Answer:
The program is given below with appropriate comments for better understanding
Explanation:
1) LMC Program:
LDA A //Load A
SUB B //Subtract from A, B which is 0.
SKZ // skip next statement if A-B == 0 , which is A == 0 as B is zero.
JMP ENDIF // jump to ENDIF point if A not equal to 0, else this step is skipped.
OUT // some statement , not called if A != 0.
ENDIF LDA A // jump statement arrives here if A != 0.
HLT //HALT
2) LMC Program:
//input first number
INP
//store it at address 99
STA 99
//input second number
INP
//add it to value at 99
ADD 99
//store the resulting sum to 99
STA 99
//input third number
INP
//add the number to value at 99 address(which is the sum of first and second number)
ADD 99
//output sum
OUT
//halt
HLT
Which of the following would not be a probable reason for choosing simulation as a decision-making tool?
Answer:
The correct answer is letter "B": There is a limited time in which to obtain results .
Explanation:
Decision-making tools allow entrepreneurs to analyze their companies from different angles thanks to the information provided. Market research, decision matrix, cost-benefit analysis, T-Charts, or SWOT (Strengths, Weaknesses, Opportunities, and Threats) Analysis are helpful for that purpose.
If a simulation is needed before going with the analysis itself, the time it could take is not specific. In case the company has a close deadline to decide on a topic, managers should avoid simulations and go ahead with the analysis but a deep evaluation of the results must be carried out to confirm accuracy.
This class has one instance variable, a double called miles. The class has methods that convert the miles into different units.It should have the following methods:public Distance(double startMiles) - the constructor; initializes milespublic double toKilometers() - converts the miles to kilometers. To convert to kilometers, divide miles by 0.62137public double toYards() - converts miles to yards. To convert to yards, multiply miles by 1760.public double toFeet() - converts miles to feet. To convert to feet, multiply miles by 5280.public double getMiles() - returns the value of milesMain MethodTo test your class, create three Distance objects in main. One represents the distance between Karel and school, Karel and the park, and Karel and his best friend.Karel lives 5 miles from school. Karel lives 10 miles from the park. Karel lives 12 miles from his best friend.Your program should use the methods from Distance to print the number of:1. yards Karel lives from school2. kilometers Karel lives from the park3. feet Karel lives from his best friend
Answer:
The class definition with the instance variable and all the required methods is given below:
public class Distance{
double miles;
public Distance (double startMiles) {
this.miles = startMiles;
}
public double toKilometers ( ){
double kilometerValue = miles/0.62137;
return kilometerValue;
}
public double toYards(){
double yardsValue = miles*1760;
return yardsValue;
}
public double toFeet(){
double feetsValue = miles*5280;
return feetsValue;
}
public double getMiles(){
return miles;
}
}
The main method to test the class is given in the explanation section
Explanation:
public class Main {
public static void main(String[] args) {
Distance karelToSchool = new Distance(5.0);
Distance karelToPark = new Distance(10.0);
Distance karelToFriend = new Distance (12.0);
double karel_Yards_From_School = karelToSchool.toYards();
System.out.println("Karel's Yards from School is "+karel_Yards_From_School);
double karel_kilometers_from_park = karelToPark.toKilometers();
System.out.println("Karel's Kilometers from Park is "+karel_kilometers_from_park);
double karel_feets_from_friend = karelToFriend.toFeet();
System.out.println("Karel's Feets from Friend is "+karel_feets_from_friend);
}
}
Which two Apex data types can be used to reference a Saleforce record ID dynamically ?A. sObjectB. String C. ENUMD. External ID
Answer:
sObject and String
Explanation:
sObject is the universal object in Salesforce which contains an Object that may be Standard one or Custom one. And we can store any object in sObject we can get the Id as well. In string we store IDsIn External ID can be text , mail or number , it cannot be refer and in ENUMD we cannot store IDsWrite a program that allows the user to enter an integer value n and prints all the positive even integers smaller or equal to n, in decreasing order.
Answer: Following code is in python
n=int(input("Enter integer ")) //taking n as an input
if n%2==0: //if divisible by 2
for i in range(n,0,-2): //n will be included
print(i)
else:
for i in range(n-1,0,-2): //else n won't be included
print(i)
OUTPUT :
Enter integer 26
26
24
22
20
18
16
14
12
10
8
6
4
2
Explanation:
An input is taken and converted to int type as the input is of string type in python. It is checked if a number is divisible by 2 as if it is, then number is included because it is an even number and range() method is used which takes 3 numbers as parameters - start, end and step. If the step is -2 then 2 is subtracted every time from n. n is not included if it is not an even number.
write a java program that will print out the following pattern 1 12 123 1234 12345
Answer:
public class Main {
public static void main(String[] args)
{
int n,m;
int k=5;
for(n=1;n<=k;n++)
{
for(m=1;m<=n;m++)
System.out.print(m);
System.out.print(" ");
}
}
}
Explanation:
The solution to this problem is the use of nested loops of an inner and outer loop to generate a half pyramid of numbers, but displayed on the same line so we have a sequence 1 12 123 1234 12345. The outer loop iterates for n=1 to n<=5 and the inner loop that has the print statement prints the integers from for m = 1 to m<=n.
Note that the value k = 5 is hard coded which in some sense is the number of rows, that is the length of iteration of the outer loop.
Jonathan Simpson owns a construction company. One day a subcontractor calls him saying that he needs a replacement check for the job he completed at 1437 Elm Street. Jonathan looks up the job on his accounting program and agrees to reissue the check for $12,750. The subcontractor says that the original check was for only $10,750. Jonathan looks around the office and cannot find the company checkbook or ledger. Only one other person has access to the accounting program. Jonathan calls you to investigate. How would you proceed?
Answer:
I would tell to subcontractor that in this moment there is no ledger or some other person that could help me to check this out, also ill tell them that we will try to get this problem solved as soon as posible, but for now, we have wait for assistance to verify the information and escalate properly the situation.
Write the document type declaration markup statement for an HTML5 file. Be sure to include the appropriate opening and closing brackets < >.
Answer:
<!DOCTYPE html>
Explanation:
<!DOCTYPE html> is used in the HTML5. It is the document type declaration markup statement for an HTML5 file.
The document type declaration that markup statement for an HTML5 file is as follows:
<!DOCTYPE html>What is a document declaration?Document declaration may be defined as an instruction that significantly associates a particular XML or SGML document with a document type definition. In the serialized form of the document, it manifests as a short or small form of a string of markup that conforms to a particular syntax.
The given document type declaration is used in HTML5. It is the document type declaration that significant markup a statement for an HTML5 file. The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in.
This ensures that the web page is parsed the same way by different web browsers. In HTML 4.01, the DOCTYPE declaration refers to a document type definition (DTD).
Therefore, <!DOCTYPE html> is the document type declaration that markup a statement for an HTML5 file.
To learn more about Document type declaration, refer to the link:
https://brainly.com/question/14105649
#SPJ2
In the following code, what is the first line that introduces a memory leak into the program?
(Type the line number into the box below)
1: #include
2: #include
3: #include
4: int main() {
5:char *word1 = NULL;
6: word1 = malloc(sizeof(char) * 11);
7: word1 = "bramble";
8: char *word2 = NULL:
9: word2 = malloc(sizeof(char) * 11);
10: word2 = word1;
11: return 0;
12: }
Answer:
The description of the given code is given below:
Explanation:
Memory leak:
In a program, if memory is assigned to the pointer variables but that memory is already released previously then the condition of occurring the memory leakage.
Now the program :
#include <stdio.h> //header file
#include <stdlib.h> //header file
#include <string.h> //header file
int main() //main function
{
char *word1 = NULL; //line 1 (as given in the question)
word1 = malloc(sizeof(char) * 11); //line 2
free(word1); //free the memory of pointer word1 line 3
word1 = "bramble"; //line 4
char *word2 = NULL; //line 5
word2 = malloc(sizeof(char) * 11); //line 6
free(word2); //free the memory of pointer word2 line 7
word2 = word1; //line 8
return 0; //line 9
}
Therefore, line 3 is the first line that introduce a memory leak anf after that line 7 introduce it in a program.
(TCO 1) You want to find the IP address of an interface. How can you quickly do this?
Answer:
Ping the interface using the cmd or terminal
Explanation:
Write a fragment of code that will test whether an integer variable score contains a valid test score. Valid test scores are in the range 0 to 100.
Answer:
Following are the code in the C Programming Language.
//set integer datatype variable
int score;
//check condition is the score is in the range of 0 to 100
if(score > 0 && score < 100){
//print if condition is true
printf("Valid test scores");
}else{
//otherwise print the following string.
printf("test scores are Invalid");
}
Explanation:
Following are the description of the code.
In the following code that is written in the C Programming Language.
Set an integer data type variable i.e., score.Then, set the if conditional statement to check the condition is the variable "score" is greater than 0 and less the 100.If the following statement is true then print "Valid test scores".Otherwise, it print "test scores are Invalid".Write a Java method onlyDigits that takes a string as a parameter. The method should remove from the string all characters, which are not digits, and return a string that contains only digits.
Answer:
public static String onlyDigits(String in){
String digitsOnly = in.replaceAll("[^0-9]", "");
return digitsOnly;
}
A Complete program is wrtten in the explanation section
Explanation:
public class TestClass {
public static void main(String[] args) {
String a = "-jaskdh2367sd.27askjdfh23";
System.out.println(onlyDigits(a));
}
public static String onlyDigits(String in){
String digitsOnly = in.replaceAll("[^0-9]", "");
return digitsOnly;
}
}
The output: 23672723
The main logic here is using the Java replaceAll method which returns a string after replacing all the sequence of characters that match its argument, regex with an empty string
Intellectual property piracy has gotten a small boost from the increasing availability of counterfeit goods through Internet channels, such as P2P file-sharing sites and mail order or auction sites.
(A) True
(B) False
Answer:
The answer is "Option B".
Explanation:
Intellectual property is protected by law in which property, copyright, and trademarks, are uses, that enable you to gain individuals' popularity or personally benefit according to what they create.
It is a program that helps to create an environment, in which imagination and technology are used.It will change the growth by striking a balance between innovator rights and wider public interest.what is the clorox logo font?
Answer:
The answer is "bump".
Explanation:
In the logo Clorox, it is the company brand name, which provides the cleaning products. In this logo design the "bump" font is used which can be described as follows:
The bump is a definition of a level surface with a physical difference. It is also known as a font that is freely available on the internet. This font is available for individual use, and it also contains characters in the European language.What is the security vulnerability in the following code snippet? Value of my Textfield is
Answer:
The answer is "Cross-Site Scripting"
Explanation:
In the given question some information is missing, that is an option, that can be defined as follows:
A. SOQL Injection
B. Arbitrary Redirects
C. Cross-Site Scripting
D. Access Control
Cross-site scripting also called XSS. It is a web security weakness, that enables an attacker to jeopardize user experiences with a compromised application, and the other choices, which will be a list but not correctly described as follows:
In option A, It is used in input/output service, that's why it is not correct.In option B, It is a process, in which a user can control the program, that's why it is wrong.In option D, It is used to provide the accessibility, that's why it is not correct.Write a function called swatch that takes three arguments:
1. A start color,
2. An end color
3. A number of squares to generate.
Answer:
def swatch (startColor, endColor, numOfSquares):
'''
documentation:
A description of what this function does
'''
return
Explanation:
Using python programming language, we define the function called swatch and specify the parameters as required in the question. Functions are defined in python using the def keyword followed by the function's name then followed by the optional arguments list. The writing that appears between the ''' ''' is for the functions documentation, it provides a description of what the function does
Universal Containers has the following requirements:
A custom Loan object requires Org-Wide Defaults set to Private. The owner of the Loan record will be the Loan Origination Officer. The Loan record must be shared with a specific Underwriter on a loan-by-loan basis. The Underwriters should only see the Loan records for which they are assigned.
What should the Architect recommend to meet these requirements?
A. Use criteria-based sharing rules to share the Loan object with the Underwriter based upon the criteria defined in the criteria-based sharing
B. Create a lookup relationship from the Loan object to the User object. Use a trigger on the Loan object to create the corresponding record in the Loan share object
C. Create a master-detail relationship from the Loan to the User object. Loan records will be automatically shared with the Underwriter
D. Create an Apex Sharing Reason on the Loan object that shares the Loan with the Underwriter based upon the criteria defined in the Sharing Reason
Answer:
The answers is B
Explanation:
In order for the architect to meet the following requirements;
# A custom Loan object requires Org-Wide Defaults set to Private.
# The owner of the Loan record will be the Loan Origination Officer.
# The Loan record must be shared with a specific Underwriter on a loan-by-loan basis.
# The Underwriters should only see the Loan records for which they are assigned.
The architect should recommend
(B.) Creating a lookup relationship from the Loan object to the User object. Use a trigger on the Loan object to create the corresponding record in the Loan_share object
Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between 0 and 9. End with a newline. Ex:
5
7
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activ
Answer:
The C++ code is given below with appropriate comments
Explanation:
//Use stdafx.h for visual studio.
#include "stdafx.h"
#include <iostream>
//Enable use of rand()
#include <cstdlib>
//Enable use of time()
#include <ctime>
using namespace std;
int main()
{
//Note that same variable cannot be defined to two
//different type in c++
//Thus, use either one of the two statement
//int seedVal=0;time_t seedVal;
//int seedVal=0;
time_t seedVal;
seedVal = time(0);
srand(seedVal);
//Use rand to generate two number by setting range
// between 0 and 9. Use endl for newline.
cout << (0 + rand() % ((10 - 0) + 0)) << endl;
cout << (0 + rand() % ((10 - 0) + 0)) << endl;
//Use for visual studio.
system("pause");
return 0;
}
To seed the random number generator, use srand(seedVal);. To generate and print two random integers between 0 and 9, use two separate calls to rand() % 10 with a newline character at the end of each print statement.
To seed the random number generator using srand(), you would use the variable seedVal as follows:
srand(seedVal);Then to print two random integers between 0 and 9, you should call rand() twice using separate statements and utilize the modulus operator to ensure the numbers fall within the desired range:
printf("%d\n", rand() % 10);Each call to rand() should be followed with a newline character for clear output separation.