Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn cat.", then output is:


Censored


Ex: If userInput is "Dang, that was scary!", then output is:


Dang, that was scary!


Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.


#include


#include


using namespace std;


int main() {


string userInput;


getline(cin, userInput);


int isPresent = userInput.find("darn");


if (isPresent > 0){


cout << "Censored" << endl; /* Your solution goes here */


return 0;


}

Answers

Answer 1

Answer:

if(userInput.indexOf("darn") != -1) {

        System.out.println("Censored");

     }

     else {

        System.out.println(userInput);

     }

Explanation:

Answer 2

The code segment is written in C++ and it must be completed in C++.

To complete the code, we simply replace  /* Your solution goes here */ with:

}

else{

   cout<<userInput;

}

The missing code segments in the program are:

The end curly brace of the if-conditionThe else statement that will print userInput, if string "darn" does not exist in the input string.

For (1), we simply write } at the end of the 9th line of the given code segment.

For (2), the else condition must be introduced, and it must include the statement to print userInput.

The complete code where comments are used to explain each line is as follows:

#include<iostream>

#include<string>

using namespace std;

int main() {

//This declares userInput as string

string userInput;

//This gets input for userInput

getline(cin, userInput);

//This checks if "darn" is present in userInput

int isPresent = userInput.find("darn");

//If isPresent is 0 or more, it means "darn" is present

if (isPresent >= 0){

//This prints Censored

   cout << "Censored" << endl;}

//If otherwise

else{

//The userInput is printed

cout<<userInput;

}

return 0;

} // Program ends here

See attachment for the complete code and a sample run

Read more about C++ programs at:

https://brainly.com/question/12063363

Print "Censored" If UserInput Contains The Word "darn", Else Print UserInput. End With Newline. Ex: If

Related Questions

What is the difference between write back and write through?
A. With write back, main memory is updated immediately, but with write through, the memory is updated only when the block is replaced.
B. With write through, main memory is updated immediately, but with write back, the memory is updated only when the block is replaced.
C. With write through, the block is replaced when it is written, but with write back, it is replaced when it is read.
D. With write through, the block is replaced when it is read, but with write back, it is replaced when it is written.
E. They are two names for the same thing.

Answers

The difference between write back and write through is With write through, the block is replaced when it is read, but with write back, it is replaced when it is written.

D. With write through, the block is replaced when it is read, but with write back, it is replaced when it is written.

Explanation:

Write back and write through difference  as follows.

Write back update the memory cache at specific intervals times with specific conditions. Memory cache is update on corresponding memory location, which makes faster to desktop or workstation or tablet.

Written through is copied caching techniques data copied to higher level caches. Basically it copy from memory cache only. In write through mode just refresh main memory.

So write back update memory cache on specific intervals whereas write through copy the cache and make memory refresh with fresh updates.

Sometimes data you export from Access needs to be formatted as a text file instead of an Excel file.

a. True
b. False

Answers

Answer:

b. False

Explanation:

Microsoft access is a database management application that can store data that can be queried from every other microsoft applications like Word, Access, Onenote etc. its attachments can be converted to best best suit the application or client that needs the file or data.

Accesss database sheets are very to Excel worksheets or books. Tabular data, Graphs and most (if not all) data format can be linked, imported or queried between Access and Excel application. Formatting files (example csv files) to text are not necessary or encouraged when exporting files.

Importance of the need for workstation policies and LAN Domain policies.

Answers

Workstation and LAN Domain policies are crucial for defining rules around account security, including password creation, account reactivation, and secure internal communication. These policies protect digital systems from unauthorized access and misuse while preparing the organization for future technological advancements. They create an ethical framework for users to interact with the organization's technological resources.

The importance of having workstation policies and LAN Domain policies lies in maintaining a secure and efficient technological environment within an organization. Account policies can be defined for a domain to enforce rules on user accounts, which include Password Policies, Account lockout policies, and Kerberos Policies. These policies help in regulating access, enhancing security, and setting user expectations through acceptable use policies (AUPs).

For instance, password policies ensure users create strong passwords, which need to be changed after a certain period, increasing the security of organizational systems. Account lockout policies, on the other hand, define the process of regaining access to an account, minimizing the risk of unauthorized access. The Kerberos policy, which is part of a domain's security policy, facilitates secure communication within networks.

Additionally, the use of technology policies needs to accommodate for future innovation and the impact of technology on the workplace and families. Organizations, including school districts, should have clear Technology Use Policies that outline the appropriate use of their systems and the potential consequences of misuse to ensure that all users are aware of the ethical use of computational system.

nt[] num = new int[100];for (int i = 0; i < 50; i++)num[i] = i;num[5] = 10;num[55] = 100;What is the value of num.length in the array above?1. 02. 1003. 994. 101

Answers

Answer:

Option 2. 100 is correct.

Explanation:

In the above example,  we have assigned the value 100 to the array num[] while creating the object of that array.

In the next line, we are assigning the values to the array num[] through the loop which will be executed till less than 50 values as it will be started from 0 but in the next line from that we are getting the total number of elements of that array which will be 100 because length function is used to get the total number of elements in the array which is already assigned as 100.

Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays the message Can't take square root of negative number

Answers

The code for the program described in question:

import java.util.Scanner;

public class Test {

   public static void main(String[] args) {

       double number;

       double squareRootOfNumber;

       String userInput = null;

       Scanner scanner = new Scanner(System.in);

       System.out.println("Enter the number: ");

       userInput = scanner.next();

       number = Double.parseDouble(userInput);

       squareRootOfNumber = Math.sqrt(number);

       if (number < 0) {

           throw new ArithmeticException("Can't take square root of negative number");

       }

       System.out.format("Square root of number entered is %.2f %n", squareRootOfNumber);

   }

}

The output of the program will be:

Enter the number:

-90

Exception in thread "main" java.lang.ArithmeticException: Can't take square root of negative number at com.brainly.ans.Test.main(Test.java:18)

Explanation:

Function from standard Java library java.lang.Math.sqrt will not throw an ArithmeticException even its argument is negative so there is no reason to surround your code try/catch block.

Instead, we have thrown ArithmeticException manually by using throw keyword:

throw new ArithmeticException("Can't take square root of negative number");

In a class, why do you include the function that overloads the stream insertion operator, <<, as a friend function? (5, 6)

Answers

Answer:

To provide << operator access to non-public members of the class.

Explanation:

Whenever we overload << operator, an object to ostream class has to be passed as this is the class which has properties which allows printing of output to console. Moreover, this operator is used outside class all the time so if not made a global member it will produce conflicts so thats why it has to be made a friend function to allow efficient access to private members of the class. Its declaration inside class is as follows :

friend ostream& operator<<(std::ostream& os, const T& obj) ;

Describe how your leadership and service has made a positive difference in your school, inyour community, in your family and/or on the job, and how it will continue to make adifference in college and beyond.

Answers

I could describe my leadership and service as being motivational and more a credit-giver.  

I do not own the credit for every successful task that my team has accomplished. In fact, I am giving them all the recognitions they deserved. In times of struggling and great pressure, I would motivate them. Most of their complaints about my leadership method is I do not give importance to time. I normally tend to finish everything before deadlines. With these attitudes, my family learn to adapt to this behavior. They value ideas and teamworks in their respective workplace and like me, they would also hate to submit their works late. They would sometimes get positive feedback from clients for finishing their assigned tasks on time.

Given an input array of strings (characters) s, pick out the second column of data and convert it into a column vector of data. Missing data will be indicated by the number 9999. If you encounter missing data, you should set it to the average of the immediately neighboring values. (This is a bit simpler than using `interp1`.)
If the input array is s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ]; then the output variable `t` is the following column vector. t = [96 114 109.5 105 112]';
Compose a function read_and_interp which accepts an array in the above format and returns the data converted as specified. You may find the conversion function `str2num` to be useful.
(Using MATLAB Syntax only)

Answers

Answer:

Consider the following code.

Explanation:

save the following code in read_and_interp.m

 

function X = read_and_interp(s)

[m, n] = size(s);

X = zeros(m, 1);

for i = 1:m

if(str2num(s(i, 2:5)) == 9999)

% compute value based on previous and next entries in s array

% s(i, 2:5) retrieves columns 2-5 in ith row

X(i,1) = (str2num(s(i-1 ,2:5)) + str2num(s(i+1,2:5)))/2;

else

X(i,1) = str2num(s(i,2:5));

end

end

end

======================

Now you can use teh function as shown below

s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ];

read_and_interp(s)

output

ans =

96.000

114.000

109.500

105.000

112.000

Suppose that sales is a two-dimensional array of 10 rows and 7 columns wherein each component is of the type int , and sum and j are int variables.

Which of the following correctly finds the sum of the elements of the fifth row of sales?1.sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[5][j];

2.sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[4][j];

3.sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[4][j];

4. sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[5][j];

Answers

Answer:

sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[5][j];

Explanation:

here we evaluate condition in parenthesis

sum = 0 here variable sum is initialised with 0 value

now for loop executes the condition in parenthesis which is (j = 0; j < 7; j++)

j =0 is 1st condition which will be executed one time , so j = 0 means index value for loop started is with 0 as you know arrays have indexj<7 2nd condition for executing the code block which defines loop will go on till the value of j is less than 7 ,as we know the columns in question is 7(this condition must be true)j++ 3rd condition means after each iteration value of j will increase +1here this condition is true (j = 0; j < 7; j++) till 7th column sum = sum + sales[5][j]   (sales [row][column] it indicates every 5th row element of each column)

Final answer:

The correct code to find the sum of the elements of the fifth row of the 'sales' array is 'sum = 0; for(j = 0; j < 7; j++) sum = sum + sales[4][j];'.

Explanation:

To find the sum of the elements of the fifth row of the two-dimensional array sales, which has 10 rows and 7 columns, the correct option is to set sum to 0 and then use a loop to iterate over the elements of the fifth row (index 4, since array indexes start at 0) and accumulate their values into sum. The loop should iterate over the number of columns, which is 7.

Therefore, the correct code to achieve this is:

sum = 0;
for(j = 0; j < 7; j++)
   sum = sum + sales[4][j];

Notice that we use sales[4][j] because array indexing starts at 0, so the fifth row is at index 4. Also, we iterate up to 7 (the number of columns) rather than 10 (the number of rows).

John is runnig his Database application on a single server with 24 Gigabytes of memory and 4 processors. The system is running slow during peak hours and the diagnostic logs indicated that the system is running low on memory. John requested for additional memory of 8 Gigabytes to be added to the server to address the problem. What is the resultant type of scaling that John is expecting?

Answers

Answer:

Vertical Scaling

Explanation:

Vertical scaling means the ability to increase the capacity of existing hardware or software by adding resources. In this case, more GB is added (8GB) to the server to address the problem. So vertical scaling is the resultant type john is expecting.

UC is importing 1000 records and want to avoid duplicate, how can they do it?

Answers

Answer:

By unchecking the 'allow duplicate' box and checking the 'Block duplicate' box  in the SalesForce user interface. More also, including  a column in the import file that has other record name(SF ID)  will ensure no duplicate during import.

Explanation:

importing 1000 records is quiet lengthy and to avoid duplicate  it is important to include in the import file that has other record name(SF ID). By including a column that has another file ID every record will be referenced uniquely thereby easily identifying any duplicate.

It is also important to  check the ''Block duplicate' box in the salesForce user interface to ensure that records are imported without duplicate.

1. The________  member function moves the read position of a file.


2. Files that will be used for both input and output should be defined as______ data type.


3. The ________member function returns the write position of a file.


4. The ios:: _______file access flag indicates that output to the file will be written to the end of the file.


5. _______ files are files that do not store data as ASCII characters.


6. The ______ member function moves the write position of a file.


7. The __________function can be used to send an entire record or array to a binary file with one statement.


8. The______>> operator_______any leading whitespace.


9. The ________ function "looks ahead" to determine the next data value in an input file.


10.The ________ and __________ functions do not skip leading whitespace characters.

Answers

Answer:

Answers explained with appropriate comments

Explanation:

1. seekp()   //the seekp sets the position where the next character is to be   //inserted into the output stream.

2. fstream  //fstream is used for input and output for files

//just like iostream for input and output data

3. tellp();  //tellp returns the "put" or write position of the file.

4. ios::ate  //ate meaning at the end, sets the file output at the file end

5. binary files  //binary files only store 0s and 1s

6. seekg()  //seekg is used to move write position of the file

7. put  //this is used to "put" or set records or arrays to a single file

8. std::ws , skips //the std::ws is used to discard leading whitespace from an //input stream

9. peek //this looks at the next character in the input sequence

10. get, peak //get and peek do not skip leading whitespace characters

Suppose there is a class Roster. Roster has one variable, roster, which is a List of tuples containing the names of students and their number grades--for example, [('Richard', 90), ('Bella', 67), ('Christine', 85), ('Francine', 97)]. Roster has a function findValedictorian that returns the name of the student with the highest grade. Find the valedictorian of the Roster object englishClass and store it in the variable valedictorian.

Answers

Answer:

class Roster:

   def __init__(self,student):

       self.student = student

   def findValedictoian(self):

       

       highscore = 0

       studentList=[]

       bStudent = []

       valedictorian =''

       for pupil in self.student:

           if pupil[1] > highscore:

               highscore = pupil[1]

              valedictorian = pupil[0]

       return valedictorian

   

student = [('rich', 90), ('Bella', 67),('philip', 56)]

englishClass= Roster(student)

print(englishClass.findValedictoian())

Explanation:

we define the roster class using the class keyword, within the class we have our __init__ constructor and we initialize the variable student.

A class method findValedictoian is defined and it compares the grades of each student and returns the name of the student with the highest grade.

An instance is created for English class and the findValedictorian method is called and the valedictorian is printed to the screen.

As the network engineer, you are asks to design an IP subnet plan that calls for 5 subnets, with the largest subnet needing a minimum of 5000 hosts. Management requires that a single mask must be used throughout the Class B network. Which of the following is a public IP network and mask that would meet the requirements?a. 152.77.0.0/21b. 152.77.0.0/17c. 152.77.0.0/18d. 152.77.0.0/19

Answers

Answer:

d) 152.77.0.0/19 (255.255.224.0)

Explanation:

If it is required to use a single mask throughout a Class B network, this means that by default, we have 16 bits as network ID, and the remaining 16 bits as host ID.

If we need to set up 5 subnets and we need that the largest subnet can support a minimum of 5000 hosts, we need to divide these 16 bits from the Host ID part, as follows:

Number of hosts = 5000

We need to find the minimum power of 2 that meet this requirement:

2ˣ - 2 = 5,000 ⇒ x = 13

We have left only 3 bits from the original 16, and repeating the process, we find that we need to use the 3 bits in order to accommodate the 5 subnets,

due to with 2 bits we could only support 4.

So, we need that the address mask be, using the CIDR notation, /19, as we need that the first three bits from the third byte to be part of the network ID.

In decimal notation, it would be as follows:

255.255.224.0

Final answer:

The correct IP subnet plan that can support at least 5000 hosts in the largest subnet while using a Class B network and a single mask throughout is 152.77.0.0/19.

Explanation:

You are asked to provide an IP subnet plan for a scenario that requires 5 subnets, with the largest subnet supporting at least 5000 hosts, while using a single mask throughout a Class B network. To determine the correct subnet mask, you need to consider the number of hosts required for the largest subnet. Given that each subnet needs to accommodate at least 5000 hosts, the subnet must allow for more than 5000 host addresses. Calculating the number of bits for the host part, 2n - 2 must be greater than 5000 (where n is the number of host bits). This calculation gives us at least 13 bits for the host part (213 - 2 = 8190). Therefore, considering a Class B address starts with 16 network bits, adding 13 bits for the host part totals 29 bits for the network and host. Therefore, the subnet mask should be /19 (32 - 13 = 19) to meet the requirements.

With this in mind, among the given options, 152.77.0.0/19 is the correct network and mask that would meet the requirements as it provides up to 8190 possible host addresses in each subnet, which is more than sufficient for the largest subnet that requires 5000 hosts.

Which one of the following characteristics or skills of a ScrumMaster are closelyaligned with coaching?Select one:

a. Questioning
b. Protective
c. Transparent
d. Knowledgable

Answers

Answer:

A. Questioning

Explanation:

Questioning is the skill of a scrummaster that is most closely alligned with coaching, inspite of others.

Final answer:

The correct answer is "Questioning". The ScrumMaster's skill of questioning is closely aligned with coaching, as it encourages discussion, reflection, and problem-solving within the team.

Explanation:

The role of a ScrumMaster in the Scrum methodology of Agile software development includes various responsibilities that contribute to the success of the project. When considering which characteristics or skills are closely aligned with coaching within the ScrumMaster's role, the most relevant option among those provided would be questioning. A ScrumMaster utilizes questioning to facilitate discussion, encourage team reflection, and promote problem-solving abilities, all of which are essential coaching techniques. This helps the team find solutions to their impediments and continuously improve their processes, aligning with the ScrumMaster's goal of coaching the team towards self-organization and leveraging their full potential.

Trainers at Tom’s Athletic Club are encouraged to enroll new members. Write an application that allows Tom to enter the names of each of his 25 trainers and the number of new members each trainer has enrolled this year. Output is the number of trainers who have enrolled 0 to 5 members, 6 to 12 members, 13 to 20 members, and more than 20 members.

Answers

Answer:

The applicatiion and its program output are given below

Explanation:

start

    declaration:

  int numberOfMember,totalNumber,j=0

string array05[totalNumber],array612[totalNumber],array1320[totalNumber],arrayMore20[totalNumber]

string trainerName;

Loop start:

           for i=0-totalNumber

                    totalNumber=number of trainers

                    trainerName=name of trainer

                   numberOfMember=number of memberas added

                    if numberOfMember=0-5

                                  array05[j]=trainerName;

                       elseif numberOfMember=6-12

                                      array612[j]=trainerName;

                       elseif numberOfMember=13-20

                                      array1320[j]=trainerName;

                        else

                                 arrayMore20[j]=trainerName;      

                   j+=1;

end loop

Output:

for i=0-j

print    array05[i]    array612[i]    array1320[i]      arrayMore20[i]

End

Final answer:

The subject at hand revolves around the creation of a computer program for Tom's Athletic Club to register trainers and their new member enrollments. The application would collect trainer names and the count of their respective enrollments, then divide them into categories based on membership numbers. Ultimately, the application would output the number of trainers in every group.

Explanation:

The problem describes setting up an application for the needs of a company, specifically Tom's Athletic Club. It implies around a computer program that collects data from user input, in this case, the names of 25 trainers and the number of new members they have enlisted for the year. The output that the application must produce is a segmentation of the number of trainers based upon the class of members they've registered - 0 to 5, 6 to 12, 13 to 20, or more than 20.

In this scenario, we would write the application in a way that captures and calculates this information. For instance, in Python, we would create lists to store the names of trainers and the respective new members. Further on, using conditional statements, we could sort the trainers into the required groups based on the number of new members enrolled. The result would be the quantity of trainers in each category, which could then be displayed as the result.

This problem combines aspects of data collection, data analysis, and program construction, which are integral components of computer programming and software development processes.

Learn more about Computer Programming here:

https://brainly.com/question/34482855

#SPJ3

File Letter Counter

Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Use Notepad or another text editor to create a sample file that can be used to test the program.

Answers

The C++ program prompts the user for a file name and a character, counts the occurrences of the character in the file, and displays the result. Error handling is included.

Below is a simple C++ program that accomplishes the task described:

```cpp

#include <iostream>

#include <fstream>

using namespace std;

int main() {

   string fileName;

   char targetChar;

   cout << "Enter the name of the file: ";

   cin >> fileName;

   cout << "Enter the character to count: ";

   cin >> targetChar;

   ifstream inputFile(fileName);    

   if (!inputFile) {

       cerr << "Error opening file. Make sure the file exists." << endl;

       return 1;

   }

   int charCount = 0;

   char currentChar;

   while (inputFile.get(currentChar)) {

       if (currentChar == targetChar) {

           charCount++;

       }

   }

   cout << "The character '" << targetChar << "' appears in the file " << charCount << " times." << endl;

   inputFile.close();

   return 0;

}

```

This program prompts the user to enter a file name and a character. It then opens the specified file, counts the occurrences of the specified character, and displays the result. If the file is not found, it provides an error message.

Define a function below called nested_list_string. The function should take a single argument, a list of lists of numbers. Complete the function so that it returns a string representation of the 2D grid of numbers. The representation should put each nested list on its own row. For example, given the input [[1,2,3], [4,5,6]] your function should produce the following string: "1 2 3 \n4 5 6 \n" Hint: You will likely need two for loops.

Answers

Answer:

The solution code is written in Python:

def nested_list_string(list2D):    output = ""    for i in range(0, len(list2D)):        for j in range(0, len(list2D[i])):            output += str(list2D[i][j]) + " "        return output  

Explanation:

Let's create a function and name it as nested_list_string() with one input parameter, list2D (Line 1).

Since our expected final output is a string of number and therefore we define a variable, output, to hold the string (Line 2).

Next use two for loops to traverse every number in the list and convert each of the number to string using str() method. Join each of individual string number to the output (Line 3-5).

At the end, we return the output (Line 7)

The 'nested_list_string' function converts a list of lists of numbers into a string that visually represents a 2D grid, with each sublist converted to a row of numbers separated by spaces, and rows separated by newlines.

The function called nested_list_string should be defined to take a list of lists of numbers as its argument and return a string representation of the 2D grid. To achieve this, you will need to use a nested for loop. The outer loop will iterate over each sublist (which represents a row of the grid), and the inner loop will iterate over each number in the sublist, converting it to a string and appending it to a string variable along with spaces. The \n character is used to move to the next line after each sublist is processed, thus simulating rows.

Here's an example code:

def nested_list_string(list_of_lists):
   result = ''
   for sublist in list_of_lists:
       for number in sublist:
           result += str(number) + ' '
       result += '\n'
   return result

Given an input like [[1,2,3], [4,5,6]], the nested_list_string function would return '1 2 3 \n4 5 6 \n'.

_ is an important management tool that is used to monitor and manage that contract and/or project

Answers

Answer:

Earned Value Management (Even)

Explanation:

Even is the best management tool for monitoring the performance of a project by emphasizing the planning and integration of program cost.

Which of the following is an example of a complex formula?

A. =A1<= A14

B. Income – Expenses

C. SUM(A1:A14)

D. =150*.05


Plz hurry i need to know!

Answers

Answer:

=A1<=A14

Explanation:

complex formula in excel is which contain more than 1 mathematical operators . An order of mathematical operations are important to understand

there are different type of operators

Arithmetic operators Comparison operators Text operators Operators reference

here Comparison operator is an example of complex formula . Comparison operator returns TRUE/FALSE it is use to compare two values

= Equal to

< Less than

> Greater than

>= Greater than or Equal to

<= Less than or Equal to

The ________ allowed banks, investment firms, and insurance companies to consolidate. It also introduced some consumer protections, such as requiring creditagencies to provide consumers with one free credit report per year.

a. Sarbanes-Oxley Act(SOX)
b. Gramm-Leach-Bliley Act (GLBA)
c. 21 CFR Part 11
d. Homeland Security
e. Presidential Directive 12 (HSPD 12)

Answers

Answer: Graam-Leach Bliley Act(GLBA).

Explanation: This Act was passed by the United States of America Congress,it failed to the the SEC(security and exchange commission) the authority to regulate large investment firms.

This act allowed Financial services firms such as Insurance,Banks and investment firms to consolidate making them more viable and able to withstand market forces. It made some rules called the safeguard rules which enabled financial firms to protect their clients from various risks.

A radiologist’s computer monitor has higher resolution than most computer screens. Resolution refers to the:______

Answers

A radiologist’s computer monitor has higher resolution than most computer screens. Resolution refers to the: number of horizontal and vertical pixels on the screen.

Explanation:

The resolution of a screen refers to the size and number of pixels that are displayed on a screen. The more pixels a screen has, the more information is displayed on it without the user having to scroll for it.

More pixels also define and enhance the clarity of the pictures and content displayed on the screen. Pixels combine in different ratios to provide different viewing experiences for users.

Answer:

              .

Explanation:

Suppose you have the following declaration.int[] beta = new int[50];Which of the following is a valid element of beta.(i) beta[0]
(ii) beta[50]

Answers

Answer:

The answer is "Option (i)".

Explanation:

In the given question, an array is defined. It is a collection of the same type of data element, which means, array stores either a numeric value or string value at a time.  An array beta is defined, which contains 50 elements. The array elements indexing always starts with 0 which means, the first element of the array will be stored in an index value that is 0. That's why option (i) is correct.

In the modular approach to network design A. The network is built by reusing a standard design that has been refined from experience B. The network is built using Lego blocks C. Each part of the network uses a design customized to that part of the network D. The administrator of each part of the network selects their own design for their part of the network

Answers

Answer:

A. The network is built by reusing a standard design that has been refined from experience

Write a method called digitSum that accepts an integer as a parameter and returns the sum of the digits of that number. For example, the call digitSum(29107) returns 2 9 1 0 7 or 19. For negative numbers, return the same value that would result if the number were positive. For example, digitSum(-456) returns 4 5 6 or 15. The call digitSum(0) returns 0.

Answers

Answer:

The cpp program for the scenario is given below.  

#include <iostream>

using namespace std;  

// method returning sum of all digits in the integer parameter

int digitSum(int n)

{

   // variable to hold sum of all digits in the integer parameter

   int sum=0;    

   if(n == 0)

       return 0;

   else

   {

       // for negative parameter, consider positive value of the number

       if(n<0)

           n = abs(n);            

       // loop to calculate sum till number is greater than 0

       do{

               sum = sum + (n%10);

               n = n/10;            

       }while(n>0);

   }    

   // sum of all digits in the integer parameter is returned

   return sum;    

}

int main()

{

   // method is called by passing an integer parameter

   cout<<"The sum of the digits is "<<digitSum(-14501)<<endl;      

   return 0;

}

OUTPUT

The sum of the digits is 11  

Explanation:

The program works as described below.

1. The method, digitSum(), is defined as having return type as integer and taking input one integer parameter.

int digitSum(int n)

{

}

2. An integer variable, sum, is declared and initialized to 0.

int sum=0;

3. If the input parameter is 0, 0 is returned.

4. If the input parameter is negative, abs() method is used to remove the negative sign.

abs(n);

5. Inside the do-while loop, the sum of all the digits of the input parameter is computed.

do{

                sum = sum + (n%10);

                n = n/10;            

       }while(n>0);

6. The digits of the input parameter are obtained by the modulus of n, and added to the variable, sum.

7. Then, n is modified and divided by 10.

8. The digits are obtained using modulus operator on n, and added to the variable, sum till all digits have been added.

9. The loop continues till the value of n is greater than 0.

10. The variable, sum, holding the sum of all digits of the input parameter, n, is returned.

11. The main() method calls the digitSum() method.

12. The program ends with the return statement.

Final answer:

The digitSum method accepts an integer, converts it to a positive if negative, and returns the sum of its digits using a loop to extract and sum each digit.

Explanation:

The digitSum method is designed to accept an integer, treat negative numbers as positive, and then return the sum of its digits. To implement this in a programming language, you can use a loop to iterate through each digit of the number. If the given integer is negative, you can first convert it to a positive by using the absolute value function. After that, repeatedly divide the number by 10 to extract each digit (using modulus operator %), and add it to a sum variable until the number is reduced to 0.

Here's a conceptual implementation:

function digitSum(number) {
   let sum = 0;
   number = Math.abs(number); // Ensure the number is positive
   while (number > 0) {
       let digit = number % 10; // Get the last digit
       sum += digit; // Add it to the sum
       number = Math.floor(number / 10); // Remove the last digit
   }
   return sum;
}

Note: Math.abs is used to handle negative numbers, and Math.floor is to ensure integer division.

Which of the following is Microsoft’s fastest, most efficient operating system to date: a. Offering quicker application start up b. Built-in diagnostics c. Automatic recovery, d. Improved security and enhanced searching and organizing capabilities

Answers

Answer: Windows 7

Explanation: it is a computer OS

(operating system) produced by Microsoft, it was released on July 22 2009, but became available for general use on October 22 2009. Widows 7 is a version of the NT operating system, it is faster, more reliable and compatible than any other version, and it is regarded as the most efficient operating system produced by Microsoft.

int[] num = new int[100];for (int i = 0; i < 50; i++)num[i] = i;num[5] = 10;num[55] = 100;What is the index number of the last component in the array above?1. 992. 1003. 04. 101

Answers

Answer:

1. 99

Explanation:

As the array is declared with space of 100 integers, 100 integers' space will  be allocated to variable num. Moreover, Index number of last component is always the length - 1 because array's  index start with 0 and ends till length-1. As array will initialize all the remaining spaces with garbage value so they will be displayed if accessed through num[index] where index s the index number to be displayed.

As size of array is 100. So, 99 will be the index of the last component of the array.

To print the last element in the array named ar, you can write :A. System.out.println(ar.length);
B. System.out.println(ar[length]);
C. System.out.println(ar[ar.length]);
D. None of these

Answers

Answer:

Option (d) is the correct answer.

Explanation:

An Array is used to store multiple variables in the memory in the continuous memory allocation on which starting index value is starting from 0 and the last index value location is size-1.

In java programming language the array.length is used to tells the size of the array so when the user wants to get the value of the last element, he needs to print the value of (array.length-1) location so the correct statement for the java programming language is to print the last element in the array named ar is--

System.out.println(ar[ar.length-1]);

No option provides the above statement, so option d (None of these) is correct while the reason behind the other option is not correct is as follows--

Option a will prints the size of the array.Option b also gives the error because length is an undeclared variable. Option c will give the error of array bound of an exception because it begs the value of the size+1 element of the array.

A source A producing fixed-length cells is required to use a Token Bucket Traffic Shaper (TBTS) of bucket capacity b=20 cell tokens and token feed rate r=40 tokens/sec, followed by a FIFO buffer with output read rate (peak rate) limited to q=120 cells/sec. The output is A’s flow into the network. What is the long-term average cell rate for this flow?

Answers

Answer:

Please find the detailed answer as follows:

Explanation:

Long-term average cell rate is also called as sustained cell rate(SCR). It can be defined as the maximum average cell rate in a log time period(T).

The relation among the SCR, Average cell rate and Peak cell rate is as follows:

Avg.cell rate ≤ SCR ≤ PCR

If the source producing fixed-length cells at constant rate, then the long-term average cell rate will be same as peak cell rate(PCR).

_____________ accepts a table to read data from and optionally a selection predicate to indicate which partitions to scan.
a) HCatOutputFormatb) HCatInputFormatc) OutputFormatd) InputFormat

Answers

Answer:

The answer is "Option b"

Explanation:

In the given question the answer is "HCatInputFormat" because it is used to read data from HCatalog controlled table, it also used in MapReduce work and scan the partitions. and other options are incorrect that can be described as follows:

In option a, It is an output format, that is used to show the data, that's why it is not correct.In option c and option, It does not use full name that is HCatalog, that's why it is not correct.
Other Questions
In Africa, AIDS takes its toll on the population, but deaths occur most frequently in the 20-40 age group. Show a survivorship curve that would illustrate this pattern. Read the following sentences from "The Third Bank of the River."My father was a dutiful, orderly, straightforward man. And according to several reliablepeople of whom I enquired, he had had these qualities since adolescence or evenchildhood. By my own recollection, he was neither jollier nor more melancholy than theother men we knew. Maybe a little quieter.Which of the following sentences is the best paraphrase of this excerpt?My father always seemed to be somewhat sad and withdrawn.As far as I knew, my father had always been a loyal family man.Ever since he was a child, my father was both serious and subdued.From childhood to adulthood, my father was very honest and open. If the normal nucleotide sequence was TACGGCATG, what type of gene mutation is present if the resulting sequence becomes TAGGCATG?A. additionB. deletionC. substitutionD. inversion Solve the problems. Express your answers to the correct number of significant figures.(2.08 x 10^3) x (3.11 x 10^2) = ____ x 10^5 Which expression can be used to check the answer to 56 divided by negative 14=n What is rapid change in mood?? ?(i already know it but just asking) What is the output of the program?#include using namespace std;class bClass{public: void print() const; bClass(int a = 0, int b = 0); //Postcondition: x = a; y = b;private: int x; int y;};class dClass: public bClass{public: void print() const; dClass(int a = 0, int b = 0, int c = 0); //Postcondition: x = a; y = b; z = c;private: int z;};int main(){ bClass bObject(2, 3); dClass dObject(3, 5, 8); bObject.print(); cout Write a two column proof. Last Sunday, the average temperature was 8%, percent higher than the average temperature two Sundays ago. The average temperature two Sundays ago was T degrees Celsius.Which of the following expressions could represent the average temperature last Sunday?Choose 2 answers:Choose 2 answers:(Choice A)A\left(1+\dfrac{8}{100}\right)T(1+ 1008 )Tleft parenthesis, 1, plus, start fraction, 8, divided by, 100, end fraction, right parenthesis, T(Choice B)BT+8T+8T, plus, 8(Choice C)C1.08T1.08T1, point, 08, T(Choice D)D1.8T1.8T1, point, 8, T(Choice E)ET+0.08T+0.08 The eel has a certain amount of rotational kinetic energy when spinning at 14 spins per second. If it swam in a straight line instead, about how fast would the eel have to swim to have the same amount of kinetic energy as when it is spinning Audio City, Inc., is developing its annual financial statements at December 31. The statements are complete except for the statement of cash flows. The completed comparative balance sheets and income statement are summarized below: Current Year Previous Year Balance Sheet at December 31 Cash $ 70,100 $ 73,800 Accounts Receivable 16,600 22,000 Inventory 24,400 22,000 Equipment 231,000 154,000 Accumulated DepreciationEquipment (66,000 ) (49,000 ) Total Assets $ 276,100 $ 222,800 Accounts Payable $ 8,400 $ 19,800 Salaries and Wages Payable 2,100 1,000 Note Payable (long-term) 62,000 79,000 Common Stock 108,000 74,000 Retained Earnings 95,600 49,000 Total Liabilities and Stockholders Equity $ 276,100 $ 222,800 Income Statement Sales Revenue $ 212,000 Cost of Goods Sold 94,000 Other Expenses 66,000 Net Income $ 52,000 Additional Data: Bought equipment for cash, $77,000. Paid $17,000 on the long-term note payable. Issued new shares of stock for $34,000 cash. Dividends of $5,400 were paid in cash. Other expenses included depreciation, $17,000; salaries and wages, $22,000; taxes, $27,000. Accounts Payable includes only inventory purchases made on credit. Because a liability relating to taxes does not exist, assume that they were fully paid in cash. Required: 1. Prepare the statement of cash flows for the current year ended December 31 using the indirect method. (Amounts to be deducted should be indicated by a minus sign.) First-degree price discrimination:a. None of the answers are correct.b. results in the firm extracting all surplus from consumers.c. occurs when a firm charges each consumer the maximum price he or she would be willing to pay for each unit of the good purchased.d. occurs when a firm charges each consumer the maximum price he or she would be willing to pay for each unit of the good purchased and results in the firm extracting all surplus from consumers. The mean hourly wage for employees in goods-producing industries is currently $24.57 (Bureau of Labor Statistics website, April, 12, 2012). Suppose we take a sample of employees from the manufacturing industry to see if the mean hourly wage differs from the reported mean of $24.57 for the goods-producing industries. HIV is classified as a retrovirus because _____.(A) it reverts to an inactive form when it infects B lymphocytes(B) this virus is composed of two cells surrounded by a lipoprotein coat(C) it makes a DNA copy of its RNA once inside the host cell(D) it infects only cells with a CD4 receptor(E) it causes the production of HIV antibodies Situation identifies a place by its what? Humans need certain substances to make new cells and repair their tissues. Humans acquire these substances by eating nutritious foods. Which of the following characteristics of life do the above statements best support? A. Living organisms respond to changes in their external environments. B. Living organisms use matter and energy for their life processes. C. Living organisms regulate their internal environments. D. Living organisms must be able to reproduce to promote their species' survival. Your client has been given a trust fund valued at $1.07 million. He cannot access the money until he turns 65 years old, which is in 30 years. At that time, he can withdrawal $28,500 per month. If the trust fund is invested at a 5.0 percent rate, how many months will it last your client once he starts to withdraw the money? Which statement BEST describes the states industrial development by the end of the nineteenth century?A)The increased number of job seekers created more opportunities.B)A steady warm climate was conducive to an increase in production.C)New discoveries prompted greater financial backing than ever before.D)It was stronger and more diversified than at any time since the Civil War. Respond to the following prompt by writing a comparitive essay of at least 750 words.Jane Eyre was first published under the pseudonym of "Currer Bell." Ten years earlier, Charlotte Bront sent a sample of her work to the Poet Laureate of the time, Robert Southey. His reply gives us an insight into societys opinion of women writers in 1837: . . . Literature cannot be the business of a womans life, and it ought not to be. The more she is engaged in her proper duties, the less leisure she will have for it, even as accomplishment and a recreation. To those duties you have not yet been called, and when you are you will be less eager for celebrity . . .Explain how both the author and her character represent the outsider, the free spirit struggling for recognition and self-respect in the face of rejection by a class-ridden and gender-oriented society. Please help me! 20 points!warren G harding has been ranked among the worst presidents who have served, primarily due to the corruption of his administration. do you think this is a fair assessment? should harding be responsible for the actions of his political appointees? why or why not? Steam Workshop Downloader