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
Lilit [14]
1 year ago
14

write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri

ng in uppercase letters using dynamic arrays.
Computers and Technology
2 answers:
dlinn [17]1 year ago
8 0

OUTPUT of program :

Enter a string length: 5

Enter a string : hello

String in upper case letters is: HELLO

Enter a string length: 5

WRITE a Program that prompts the length of a string and the string in uppercase letters using dynamic arrays ?

#include <iostream>

#include <cstring>

#include <cctype>

using namespace std;

int main(){

char *str = new char[80];

int *num= new int[80];

char *str1=new char[80];

int len,i;

cout << "Enter a string: "

cin.get(str, 80);

cout << "Enter string length: "

cin.get(num, 80);

cout << "String in upper case letters is:"<< endl;

len = strlen(str);

for (i = 0; i <len; i++)

{

 *(str1+i)=toupper(*(str+i));

}

for(i=0;i<len;i++)

{

 cout<<*(str1+i);  

}

return 0;

}

C++ :

     

           Performance, effectiveness, and flexibility of usage were the design pillars of C++, which was created with systems programming, embedded, resource-constrained software, and big systems in mind. The software infrastructure and resource-constrained applications, such as desktop programmes, video games, servers, and performance-critical programmes, are two areas where C++ has been proven to be very useful.

                      Generic programming is made possible via C++ templates. Function, class, alias, and variable templates are supported in C++. Types, compile-time constants, and other templates can all be used to parameterize templates. At compile time, templates are implemented by instantiation. Compilers use particular inputs in place of a template's parameters to create a concrete instance of a class or function. Some substitutes are not possible, and an overload resolution policy with the motto "Substitution failure is not an error" eliminates these cases (SFINAE).                  

        C++ gives C features for object-oriented programming (OOP). It provides classes that offer the four features frequently found in OOP languages: polymorphism, inheritance, encapsulation, and abstraction. Support for deterministic destructors, which in turn provides support for the Resource Acquisition is Initialization (RAII) idea, sets C++ classes apart from classes in other programming languages.

       

To learn more about C++ refer :

brainly.com/question/13168905

#SPJ1

ycow [4]1 year ago
8 0

A random access, variable-size list data structure called a dynamic array, growable array, resizable array, dynamic table, or array list allows elements to be added or removed.

<h3>What is dynamic array?</h3>
  • A random access, variable-size list data structure called a dynamic array, growable array, resizable array, dynamic table, or array list allows elements to be added or removed. It comes with standard libraries for many current, widely used programming languages.
  • Similar to a standard array, a dynamic array can have its size changed while the program is running. Each element of a DynamArray takes up a single block of memory. The size of an array cannot be altered once it has been constructed.

#include <iostream>

#include <cstring>

#include <cctype>

using namespace std;

int main(){

char *str = new char[80];

int *num= new int[80];

char *str1=new char[80];

int len,i;

cout << "Enter a string: "

cin.get(str, 80);

cout << "Enter string length: "

cin.get(num, 80);

cout << "String in upper case letters is:"<< endl;

len = strlen(str);

for (i = 0; i <len; i++)

{

*(str1+i)=toupper(*(str+i));

}

for(i=0;i<len;i++)

{

cout<<*(str1+i);  

}

return 0;

}

To learn more about C++ refer :

brainly.com/question/13168905

#SPJ1

You might be interested in
Which organization developed a network called CSNET to provide a network free to all American research and educational instituti
Citrus2011 [14]
<span>The National Science Foundation (NSF) is the organization which </span><span>developed a network called CSNET to provide a network free to all American research and educational institutions. It is an agency in the government of the United States that is responsible for research and development in the field of science and engineering. </span>
7 0
3 years ago
Define a public static method named s2f that takes two String arguments, the name of a file and some text. The method creates th
frez [133]

Answer:

Java solution (because only major programming language that has public static methods)

(import java.io.* before hand)

public static boolean s2f(String fileName, String text){

   try{

       PrintWriter out = new PrintWriter(new File(fileName));

       out.println(text);

       out.close();

       return true;

   }

   catch(Exception e){

       return false;

   }

}

6 0
2 years ago
Which of the following is a benefit of a digital network?
k0ka [10]

Answer:

Multiple devices can be connected

8 0
3 years ago
A network administrator is planning redundant devices and cabling in a switched network to support high availability. Which bene
a_sh-v [17]

Answer:

Redundant paths can be available without causing logical Layer 2 loops.

Explanation:

  • Spanning Tree Protocol is used to allow redundancy in the Layer 2 switched networks without creating cycles/circles also called loops.
  • These loops are called physical loops.
  • When two parts of the switched network are connected via two or more Layer 2 switches this result in a loop.
  • This affects the performance of the network as the result of broadcast packets flooding.
  • STP puts one port of the switch to forward mode and the rest of the ports within the same part of the network to the blocking mode to avoid broadcast packet flooding. STP puts all the ports that are allowing redundant paths to block mode and the one port that is left after this is placed in forward mode.
  • Spanning Tree Algorithm is used by STP to determine the optimal path  of switch to the network.
  • Bridge Protocol Data Units are used to share the information about the optimal path determined by the spanning tree algorithm with other switches.
  • This information helps STP to eliminate the redundant paths.
  • So this is how STP tracks all the links in the switched network and eliminates redundant loops by allowing only one active path to the destination while blocking all other paths.
7 0
2 years ago
Use the five-step decision-making process discussed in Chapter 1 to analyze the following situations and recommend a course of a
RideAnS [48]

Answer:

The responses to this question can be defined as follows:

Explanation:

Yeah, their numerous sponsorships brands have potential. Every business does have its Trademarks for a commodity, that distinguishes others. It's an infringement for trademarks, it has only provided to those trivialities, which success and if I would plan this for my friend. I would never list or show those points of his accomplishments I never would Numerous sponsors. This should include all its information using its trademarks as well as other Site partners are excluded even though they are or are browsing their trademarks where the law is prohibited.

7 0
3 years ago
Other questions:
  • Which statement describes the word "iterative"?
    7·2 answers
  • When you want to avoid sending email that a recipient may feel their privacy has been invaded, how would you fill in the (To) bo
    13·1 answer
  • "PindCart, an online retailer, places a small file on the computer hard drive of its visitors to recognize them when they revisi
    7·1 answer
  • Which of the following is another term for a subfolder?
    9·1 answer
  • One form of e-mail attack that is also a DoS attack is called a mail spoof, in which an attacker overwhelms the receiver with ex
    14·1 answer
  • 30 points) Suppose you are given a string containing only the characters ( and ). In this problem, you will write a function to
    14·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • What is the function of a breadcrumb trail in a website?
    13·1 answer
  • A keyboard, mouse, and microphone are examples of ________.
    9·2 answers
  • Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!