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
Anettt [7]
3 years ago
11

Overview In C, a string is simply an array of characters. We have used literal strings all along – the stuff in between the quot

es in a printf is a literal string. A literal string can be stored in a character array for later use, just as you would store the value 12 in an int variable. The string library string.h provides several functions for manipulation strings. In this week’s lab, you will see static and dynamic ways of storing strings, and write your own versions of the string library function strcpy(), which copies one string into another.
Engineering
1 answer:
salantis [7]3 years ago
3 0

#include<stdio.h>

#include<string.h>

 

int main() {

  char str1[100];

  char str2[100];

 

  printf("\nEnter the String 1 : ");

  gets(str1);

 

  strcpy(str2, str1);

  printf("\nCopied String : %s", str2);

 

  return (0);

}

You might be interested in
A power plant operates on a regenerative vapor power cycle with one open feedwater heater. Steam enters the first turbine stage
faltersainse [42]

Answer:

a) 0.489

b) 54.42 kg/s

c) 247.36 kW/s

Explanation:

Note that all the initial enthalpy and entropy values were gotten from the tables.

See the attachment for calculations

4 0
3 years ago
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName Str
stiks02 [169]

Answer:

The program requires that you have the specified input files and it reads from each file at a time and processes salary in digits, states the city, state and bonus with respective first and last name as requested in the question. Note that you must have access to the mentioned output files for the program to work properly. Below is the java version of the program.

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

class Driver

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner sc = new Scanner(new File("strInput.txt"));

PrintWriter pd = new PrintWriter(new File("strOutputD"));

PrintWriter prf = new PrintWriter(new File("strOutputRF"));

String firstname = "", lastname = "", strSalary = "", status = "", cityState = "", city = "", state = "";

double salary = 0, bonus = 0;

int incorrectRecords = 0;

int dRecords = 0;

int fRecords = 0;

while(sc.hasNextLine())

{

firstname = sc.next();

lastname = sc.next();

strSalary = sc.next();

status = sc.next();

cityState = sc.next();

if(!status.equals("D") && !status.equals("F"))

{

System.out.println("Records is neither D nor F. Skipping this...");

incorrectRecords++;

continue;

}

else if(status.equals("D") || status.equals("F"))

{

char c = ' ';

int i = 0;

for(i=0; i<strSalary.length() && c != '.'; i++)

{

c = strSalary.charAt(i);

if(!Character.isDigit(c))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

if(c == '.')

{

if(i+1 == strSalary.length()-1)

{

if(!Character.isDigit(strSalary.charAt(i)))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

if(!Character.isDigit(strSalary.charAt(i+1)))

{

System.out.println("Char at position " + (i+1+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

else

{

System.out.println("Period is in the wrong position. Expected at " + (strSalary.length()-3) + " but found at " + (i+1));

continue;

}

}

city = cityState.split(",")[0];

state = cityState.split(",")[1];

salary = Double.parseDouble(strSalary);

if(status.equals("D"))

{

bonus = salary * 0.125;

dRecords++;

pd.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

else

{

bonus = salary * 0.18;

fRecords++;

prf.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

}

}

System.out.println("No of D records : " + dRecords);

System.out.println("No of F records : " + fRecords);

System.out.println("No of incorrect records : " + incorrectRecords);

}

}

6 0
3 years ago
Which of the following elements of the CIA triad refers to maintaining and assuring the accuracy of data over its life-cycle?
kenny6666 [7]

Answer:

Integrity: involves maintaining and assuring the accuracy of data over its life-cycle

Explanation:

Confidentiality: This is a CIA triad designed to prevent sensitive information from reaching the wrong people, while making sure that the right people have access to it.

Integrity: This is a CIA triad that involves maintaining the consistency, accuracy, and trustworthiness of data over its entire life cycle.

Availability: This is a CIA triad that involves hardware repairs and maintaining a correctly functioning operating system environment that is free of software conflicts.

Authentication:This is a security control that is used to protect the system with regard to the CIA properties.

4 0
3 years ago
Design a plate and frame heat exchanger for the following problem:
qwelly [4]

Answer:

See explaination and attachment.

Explanation:

Iteration method is a repetitive method applied until the desired result is achieved.

Let the given equation be f(x) = 0 and the value of x to be determined. By using the Iteration method you can find the roots of the equation. To find the root of the equation first we have to write equation like below

x = pi(x)

Let x=x0 be an initial approximation of the required root α then the first approximation x1 is given by x1 = pi(x0).

Similarly for second, thrid and so on. approximation

x2 = pi(x1)

x3 = pi(x2)

x4 = pi(x3)

xn = pi(xn-1).

please go to attachment for the step by step solution.

8 0
3 years ago
What does it take to launch a rocket in space?
Dafna11 [192]
To get rockets into orbit, they need much more thrust than the amount that will get them up to the required altitude. They also need sufficient thrust to allow them to travel with very high orbital speed. ... If speed is less than this, an object will fall back to the Earth
3 0
3 years ago
Read 2 more answers
Other questions:
  • Which option is a potential environmental risk of adopting a new technology?
    5·1 answer
  • If a ball is dropped from a height​ (H) its velocity will increase until it hits the ground​ (assuming that aerodynamic drag due
    5·1 answer
  • Our goal is to design a traffic-light controller with the following properties; it lights up the green light (output G) for 15 s
    7·1 answer
  • I need solution for this question please ​
    7·2 answers
  • A simply supported beam spans 25 ft and carries a uniformly distributed dead load of 0.6 kip/ft, including the beam self-weight,
    15·1 answer
  • What is the definition of a tolerance on a dimension typically found on technical drawings?
    7·1 answer
  • A kite is an airfoil that uses the wind to produce a lift. Held in place by a string, a kite can remain aloft indefinitely. The
    9·1 answer
  • Crest is to high, as through is to
    12·2 answers
  • Mnsdcbjksdhkjhvdskjbvfdfkjbcv hjb dfkjbkjfvvfebjkhbvefgjdf
    7·2 answers
  • Which of the following sensors is used to provide suspension control module with feedback regarding vehicle cornering​ forces?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!