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
Whitepunk [10]
3 years ago
15

The following program declares an array of char named as myString There are 6 following cases (a, b, c, d, e, f) to access myStr

ing. Which cases are valid access? If there are any invalid cases, how to correct them? #include using namespace std; int main() { char myString[16]; //a. strcpy_s(myString, "Hello the world"); //b. cout << strlen(myString); //c. myString = "Mary Lane"; //d. cin.getline(myString, 80); //e. cout << myString; //f. myString[6] = 't'; return 0;
Computers and Technology
1 answer:
yuradex [85]3 years ago
3 0

Answer:

See explaination

Explanation:

a.

myString is "Hello the world"

b.

prints "15"

c.

This is invalid.

We have to use strcpy_s to copy strings

FIX:

strcpy_s(s,"Marylane");

d.

reading string upto length 80 from the user and stored it in myString variable

e.

prints the string enetered by user to console

f.

replacing 7th character by 't'

You might be interested in
Assume that word is a variable of type string that has been assigned a value. Write an expression whose value is a string consis
Helga [31]

Answer:

Explanation:

The language I use would do it as

h1$ = copy(h$,1,3)

This may not satisfy you, because your language could be quite different. You might want an input statement of some kind that would define h$. This assumes that somewhere h,h1 are declared as  strings.

You also have to know how to read an input. My language uses readln(input,h)

and how to write it on the screen write(h1) or writeln(h1)

6 0
3 years ago
According to the order of operation in Excel: a. Excel performs exponentiation, then multiplication, then division, then subtrac
Ilya [14]

Answer:

Option is b is correct answer. Excel performs exponentiation, then multiplication and division, then addition, and subtraction, it is correct order of operation in Excel. It is important to remember when you write any formula in Excel having different mathematical operators like +/ -/ ^/  etc, it follows a specific order and performs calculations in specific order which is termed as order of operator precedence. Each of mathematical operator has its precedence and executes in a special order set by Excel.

Explanation:

  • As we already know order of precedence of each mathematical operator is different in Excel. The order of operations for Excel is as follows:

  • Evaluate elements in parentheses.
  • Evaluate 'ranges' ().  
  • Evaluate 'intersections' (empty spaces).  
  • Evaluate 'unions' (,).
  • Perform negation (-).  
  • determine percentages (%).  
  • Perform exponentiation (^).  
  • Perform multiplication (*) and division (/), both are of equal precedence.  
  • Perform addition (+) and subtraction (-), both are of equal precedence.  
  • Evaluate text operators like (&).  
  • Perform comparisons like (=, <>, <=, >=).

 

Answer details  

Grade: Middle

Subject: Computers and Technology

Chapter: Order of precedence of mathematical operators

Keywords: precedence in Excel, operators precedence etc

7 0
4 years ago
I want an A! Write a pseudocode algorithm that asks the user for their grades in CSE 1321, along with their attendance, then cal
Vsevolod [243]

Answer:

The Java pseudocode and the Java code itself are given for better understanding

Explanation:

<u>Java pseudocode</u>

  1. preAvg(int test[], int qgrade):
  2. sum := 0
  3. for each testi in test:
  4. sum := sum + testi
  5. sum := sum + qgrade
  6. return sum / 5
  7. additional(int at):
  8. res = (at * 1.5) / 30
  9. return res
  10. total = preAvg(test, qgrade) + additional(at)

<u>Java code</u>

import java.util.Scanner;

public class CSE1322 {

  public static void main(String[] args) {

     

      Scanner scanner=new Scanner(System.in);

     

      int test[] = new int[4];

     

      for(int i=1;i<=4;i++){

          System.out.println("Enter your result for test"+i+": ");

          test[i-1] = scanner.nextInt();

      }

     

      System.out.println("Enter the average quiz grade: ");

      int qgrade = scanner.nextInt();

     

      System.out.println("Enter the classes you attended(out of 30): ");

      int at = scanner.nextInt();

     

      double avg = preAvg(test,qgrade);

      System.out.println("Your average before attendance is: "+avg);

     

      double add = additional(at);

      System.out.println("You receive an additional "+add+" points for attendance");

     

      double total = avg + add;

     

      System.out.println("Final grade is : "+total);

     

  }

  private static double additional(int at) {

      double res = ((double)at * 1.5)/30.0;

      return res;

  }

  private static double preAvg(int[] test, int qgrade) {

      double sum = 0;

     

      for(int i=0;i<4;i++) sum += test[i];

     

      sum += qgrade;

     

      return sum/5;

  }

}

4 0
4 years ago
Is Bluetooth considered a computing innovation?
Scilla [17]

Answer:

yes it is becauuse through bluetooth i can play cod mobile on my phone wiith my ps4 controller

Explanation:

A Bluetooth device works by using radio waves instead of wires or cables to connect with your cell phone, smartphone or computer. Bluetooth is a wireless short-range communications technology standard found in millions of products we use every day – including headsets, smartphones, laptops and portable speakers.

8 0
3 years ago
A desktop computer (named workstation22) can’t connect to the network. A network card was purchased without documentation or dri
Lelechka [254]

Answer:

<em>The first step is to download the driver file from the Internet using  another Computer system, Copy the driver to a flash or CD then run the installation file on the Desktop Computer.</em>

Explanation:

<em>Driver files can be easily gotten from software sites online or from other secure websites, most times you have to pay for these driver files in some sites for secure and authentic download.</em>

<em>it is very necessary  that the user takes note of the exact system name, model and system architecture with respect to when downloading the driver file.</em>

4 0
4 years ago
Other questions:
  • Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement? 1 2 3 4 5 6 7 public
    12·1 answer
  • Where are the Add Level and Delete Level buttons located? Filter options list Sort &amp; Filter group Sort dialog box Custom fil
    11·1 answer
  • Fallon is a new student on campus. Everywhere she goes, she is asked for her 12-digit student number. To memorize her new studen
    10·1 answer
  • On net, is technology good or bad for society? Please explain, support your argument, I’ll mark brainliest
    9·2 answers
  • A security manager has discovered that sensitive information stored on a server has been compromised. The organization is requir
    7·1 answer
  • What is a prototype ?
    9·1 answer
  • Tips for Interactions with Personalized LinkedIn Outreach?
    5·1 answer
  • A letter of application should be written on:
    13·1 answer
  • Choose one skill needed to become Computer Network Administrator?
    10·2 answers
  • Select the correct text in the passage.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!