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

Mix ‘em Let s1 and s2 be 2 c-strings of the same length. Write a function char* mixem(char*s1, char* s2) which returns a c-strin

g made up of the characters of s1 and s2 "interleaved", starting with the first character of s1. Example: S1="abc", s2="123" The call mixem(s1,s2) returns the c-string "a1b2c3" Note: If s is a c-string, strlen(s) returns the length of the string (not counting the terminating null character ‘\0’.) Every c-string has a null character at the end.
Computers and Technology
1 answer:
Shkiper50 [21]3 years ago
5 0

Answer:

See Explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace std;

char *mixem(char *s1, char *s2);

int main() {

cout << mixem("abc", "123") << endl;

cout << mixem("def", "456") << endl;

return 0;

}

char *mixem(char *s1, char *s2) {

char *result = new char[1 + strlen(s1) + strlen(s2)];

char *p1 = s1;

char *p2 = s2;

char *p = result;

while (*p1 || *p2) {

if (*p1) {

*p = *p1;

p1++;

p++;

}

if (*p2) {

*p = *p2;

p2++;

p++;

}

}

*p = '\0';

return result;

}

You might be interested in
Using a pin or password in addition to tpm is an example of what type of authentication?
anzhelika [568]
Considering it is private i would say security?
3 0
2 years ago
What steps can you take to secure your private information?.
pogonyaev

Answer:

Below:

Explanation:

1. Practice mail security. Use a public mailbox rather than your home mailbox to send bill payments and other mail containing sensitive information. Pick your mail up promptly and ask the post office to hold it while you’re away.

2. Guard your Social Security number. Don’t carry your Social Security card, military ID, Medicare, or other cards that have your Social Security number on them unless you are going somewhere where you will need them. Only provide your Social Security number when there is a legitimate need to do so.

3. Lock and shred. Keep your billing and banking statements and other personal records locked up and shred them when no longer needed.

4. Stop prescreened credit and insurance mailings. Call toll-free 1-888-567-8688 to get off mailing lists for credit and insurance offers. Your Social Security number will be required. This keeps thieves from intercepting and accepting the offers in your name and doesn’t affect your eligibility for credit or insurance.

5. Keep private information to yourself. Never respond to phone calls or emails asking to confirm your Social Security number or account numbers. Don’t leave PIN numbers, passwords or other personal information around for others to see.

6. Be safe online. Use anti-virus and anti-spyware software and a firewall on your computer and keep them updated. When you provide financial or other sensitive information online, the address should change from “http” to “https” or “shttp.” A symbol such as a lock that closes may also indicate that the transmission is secure.

7. Look at your bills and bank statements promptly. If you find any charges or debits that you never made, contact the bank or company immediately.

Hope it helps.......

It's Muska...  

6 0
2 years ago
A leading global vendor of computer software, hardware for computer, mobile and gaming systems, and
V125BC [204]

Answer:

Microsoft

Explanation:

5 0
2 years ago
how can you create fades with the smart tool? How can you specify the types of fade curves that are used with the smart tool?
ra1l [238]

Answer:

The correct answer to the following question is:

To create fades you can click and then drag the end of the clip with a smart tool.

Fade Dialog Box is the fade curve.  

Explanation:

Smart Tool is an application which also provide their users with the features of the quick access menu by which they can easily access their programs or the software.

By using smart tool the user also creates a crossfade.

8 0
2 years ago
This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance
aksik [14]

Answer:

import java.util.Scanner;

public class TeamRoster {

  public static void main(String[] args) {

     Scanner scan = new Scanner(System.in);

     int[][] players = new int[5][2];

     boolean keepAlive = true;

     char input;

     

     for (int i = 0; i < 5; i++) {

        System.out.println("Enter player " + (i+1) + "'s jersey number: ");

        players[i][0] = scan.nextInt();

        if( players[i][0] >= 0 && players[i][0] < 100 ) {

             System.out.println("Enter player number less than 100");

               System.out.println("Enter player " + (i+1) + "'s rating: ");

               players[i][1] = scan.nextInt();

               if ( players[i][1] >= 1 && players[i][1] <10 ) {

                     System.out.println();

               }    else {

                     System.out.println("Enter player " + (i+1) + "'s rating: ");

                     players[i][1] = scan.nextInt();

               }

     }

     }

     System.out.println();

     outputRoster(players, 0);

     

     while (keepAlive) {

        outputMenu();

        input = scan.next().charAt(0);

        if (input == 'q') {

           keepAlive = false;

           break;

        } else if (input == 'o') {

           outputRoster(players, 0);

        } else if (input == 'u') {

           System.out.println("Enter a jersey number: ");

           int jerseyNum = scan.nextInt();

           System.out.println("Enter a new rating for the player: ");

           int newRating = scan.nextInt();

           for (int l = 0; l < 5; l++) {

              if (players[l][0] == jerseyNum) {

                 players[l][1] = newRating;

              }

           }

        } else if (input == 'a') {

           System.out.println("Enter a rating: ");

           int rating = scan.nextInt();

           outputRoster(players, rating);

        } else if (input == 'r') {

           System.out.println("Enter a jersey number: ");

           int jerseyNum = scan.nextInt();

           boolean exists = true;

           for (int l = 0; l < 5; l++) {

              if (players[l][0] == jerseyNum) {

                 System.out.println("Enter a new jersey number: ");

                 players[l][0] = scan.nextInt();

                 System.out.println("Enter a rating for the new player: ");

                 players[l][1] = scan.nextInt();

              }

           }

           

        }

     }

     

     return;

  }

   

  public static void outputRoster(int[][] players, int min) {

     System.out.println(((min>0) ? ("ABOVE " + min) : ("ROSTER")));

     int item = 1;

     for (int[] player : players) {

        if (player[1] > min) {

           System.out.println("Player " + item + " -- Jersey number: " + player[0] + ", Rating: " + player[1]);

        }

        item++;

     }

     System.out.println();

  }

   

  public static void outputMenu() {

     System.out.println("MENU");

     System.out.println("u - Update player rating");

     System.out.println("a - Output players above a rating");

     System.out.println("r - Replace player");

     System.out.println("o - Output roster");

     System.out.println("q - Quit\n");

     System.out.println("Choose an option: ");  

  }

}

Explanation:

The program is written in Java.

It is a bit straightforward.

The Scanner module is declared and used to collect input from the user.

The program prompts the user for each player jersey then rating.

All five players details are collected.

The program shows the output of all the entries.

5 0
3 years ago
Other questions:
  • When using the “reply all” option, your message will automatically be sent to ____ recipients of the original message. ​?
    7·2 answers
  • Design a method for representing the state of a tic-tac-toe board in computer memory. can you fit your representation into three
    12·2 answers
  • Suppose you wanted to run a web server or ftp server from your home. what type of ip address would you want?​
    6·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    10·2 answers
  • Someone who is young, lacks funds, and really wants to gain technical skills while serving his or her nation should consider
    8·1 answer
  • Which of the following are types of home internet service? Check all that apply
    7·1 answer
  • Windows 1.0 was not considered to be a "true" operating system but rather an operating environment because _____.
    13·1 answer
  • Write a regular expression that selects lines containing any of the following words: linux windows solaris macos. For this exerc
    13·1 answer
  • Explain the difference between overexposed vs. underexposed images?
    15·2 answers
  • True or False? Popular sites are always mean accurate.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!