answer.
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
ruslelena
1 month ago
5

A have a string, called "joshs_diary", that is huge (there was a lot of drama in middle school). But I don't want every one to k

now that this string is my diary. However, I also don't want to make copies of it (because my computer doesn't have enough memory). Which of the following lines will let me access this string via a new name, but without making any copies?
a. std::string book = joshs_diary;
b. std::string & book = joshs_diary; const
c. std::string * book = &joshs_diary;
d. std::string book(joshs_diary);
e. const std::string & book = joshs_diary;
f. const std::string * const book = &joshs_diary;
g. std::string * book = &joshs_diary;
Computers and Technology
1 answer:
maria [879]1 month ago
5 0

Answer:

C and G

Explanation:

In the C programming language, the symbols ' * ' and ' & ' are utilized to create pointers and access references to those pointers, respectively. The ' * ' is used in conjunction with specific identifiers to define a pointer to a variable's location in memory, whereas the ' & ' is always positioned in front of a variable as an r_value for the specified pointer.

You might be interested in
What advantage do ExpressCard modules and USB adapters offer over expansion cards?
ivann1987 [930]
<span>ExpressCard modules and USB adapters are more compact and offer enhanced speed. They facilitate easy connection to a computer, enabling users to expand memory, along with wired and wireless communication, multimedia, and security capabilities simply by inserting the compact card or adapter into a designated slot in the computer.</span>
3 0
12 days ago
The president of the company wants a list of all orders ever taken. He wants to see the customer name, the last name of the empl
zubka84 [936]

Response:

refer to the explanation

Clarification:

Examine the SQL statement shown below:

SELECT c.CustomerName, e.LastName, s.ShipperName, p.ProductName, o.Quantity, od.OrderDate

FROM

Customers c, Employees e, Shippers s, Orders o, OrderDetails od, Products p

WHERE c.customerID = o.customerID AND

e.employeeID = o.employeeID AND

o.orderID = od.orderID AND

od.shipperID = s.shipperID AND

od.productID = p.productID;

6 0
25 days ago
When long labels are required, which of these commands can you use to improve readability of a worksheet?
maria [879]
I think it's text wrapping! I hope this assists you.
6 0
8 days ago
Read 2 more answers
Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with a
8_murik_8 [887]

Answer:

Below is the JAVA program:

import java.util.Scanner;   //to take input from user

public class Main {  //name of the class

  public static void main(String[] args) {  //beginning of main method

      Scanner input = new Scanner(System.in);  //creates Scanner instance

      int integer = input.nextInt();  //defines and collects an integer for the number of words

      String stringArray[] = new String[integer]; //initializes an array to hold strings

      for (int i = 0; i < integer; i++) {  //iterates through the array

          stringArray[i] = input.next();         }  //collects strings

      int frequency[] = new int[integer];  //creates an array for holding frequencies

      int count;         //initializes variable to calculate frequency of each word

      for (int i = 0; i < frequency.length; i++) {  //iterates through frequency array

          count = 0;  //sets count to zero

          for (int j = 0; j < frequency.length; j++) {  //iterates through array

              if (stringArray[i].equals(stringArray[j])) {  //checks if element at ith index matches jth index

                  count++;                 }            }  //increments count

          frequency[i] = count;      }  //stores count in the frequency array

      for (int i = 0; i < stringArray.length; i++) {  //iterates through the string array

          System.out.println(stringArray[i] + " " + frequency[i]);         }    }    } //displays each word and its frequency

Explanation:

To illustrate the program, consider:

let integer = 3

for (int i = 0; i < integer; i++) is used to input strings into stringArray.

On the first pass:

i = 0

0<3

stringArray[i] = input.next(); takes a word and saves it to the ith index of stringArray. For example, if the user types "hey", it will be in stringArray[0].

Then, i increments to i = 1

On the second pass:

i = 1

1<3

stringArray[i] = input.next(); takes another word and assigns it to stringArray[1]. If the user enters "hi", then hi will be in stringArray[1]

Next, i becomes i = 2

On the third pass:

i = 2

2<3

stringArray[i] = input.next(); captures a word and places it in stringArray[2]. If the user types "hi", it goes to stringArray[2]

Then, i increments to i = 3

The loop terminates since i<integers is false.

The next outer loop for (int i = 0; i < frequency.length; i++) and inner loop for (int j = 0; j < frequency.length; will check each word and if (stringArray[i].equals(stringArray[j])) identifies any duplicates. Words that repeat will have their count incremented and the frequency array will record these values. For example, hey appears once while hi shows up twice, thus resulting in the final outputs:

hey 1

hi 2

hi 2

The visual representation of the program and its outcome based on the example provided is attached.

4 0
1 month ago
Leah Jones is the IT manager at Rock Solid Outfitters, a medium-sized supplier of outdoor climbing and camping gear. Steve Allen
Natasha_Volkova [897]

Answer:

Step 1: Create a table reflecting the three potential scenarios and two possible outcomes. There should be a total of 8 distinct rules for the three varying conditions, structured similarly to the discount table shown here in the example: attached is the discount table

Step 2: The rules can now be made simpler by taking the following aspects into account:

a) When a consumer completes the survey form AND opts into the newsletter, according to Rules 1 and 2, they qualify for a discount if their order exceeds $100. This leads to two distinct rules being formulated while the third condition (order quantity) holds significance.

b) If the buyer fills out the survey form OR subscribes to the newsletter, as indicated by Laws 3, 4, 5, and 6, they will benefit from free shipping, regardless of the order amount. As a result, this situation can be divided into two individual rules, where at least one requirement is satisfied, but not both.

c) When a customer fails to meet any requirements, corresponding to Rules 7 and 8, the order value will not qualify for either free shipping or discount. This can be seen as a single law. The linked simplification table illustrates this.

7 0
14 days ago
Other questions:
  • In what areas is Leslie's underspending hurting her budget select all that apply
    5·1 answer
  • When using the Python shell and code block, what triggers the interpreter to begin evaluating a block of code
    14·1 answer
  • Which of the following statements is true regarding input and output?
    12·2 answers
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Tag groups can be nested up to ____ levels deep, with up to _______ tag subgroups under a single parent.
    14·1 answer
  • 3. Megan and her brother Marco have a side business where they shop at flea markets, garage sales, and estate
    9·1 answer
  • Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
    15·1 answer
  • When a CPU executes instructions as it converts input into output, it does so with
    12·1 answer
  • A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is true if the el
    10·1 answer
  • What problem does the DNS solve? How does the DNS help the world wide web scale so that billions of users can access billions of
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!