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
Select the two statements below that are true. Press on the info button for
bulgar [2K]

Answer:

The command print must be in lower case.

To show a variable or a number you do  not need quotation marks.

Explanation:

print("string here")

strings can be created with single or double quotes

print(3+5) returns 8

4 0
3 years ago
which classification of money describes money that can be accessed quickly and easily, and includes coins and paper money as wel
zhenek [66]

Money that can be promptly and easily appraised falls under the M1 Money classification.

<h3>What are broad and narrow money, respectively?</h3>

Broad money typically refers to M2, M3, and/or M4. The most liquid kinds of money, such as currency (banknotes and coins), as well as bank account balances that may be instantly changed into currency or used for cashless transactions, are generally referred to as "narrow money" (overnight deposits, checking accounts).

<h3>Describe Narrow Money.</h3>

All of the actual money that the central bank has falls under the category of "narrow money," which is a subset of the money supply. Demand deposits, money, and other liquid assets are included. In the US, "narrow money" is referred to as M1 (M0 plus demand accounts).

To know more about Money classification visit:-

brainly.com/question/28095328

#SPJ1

5 0
1 year ago
Styles are modified by using the Office clipboard in the Home tab. true or false
cluponka [151]
Your answer is false
7 0
3 years ago
Read 2 more answers
Refer to Table 8-4. Consider the data above (in billions of dollars) for an economy: Gross domestic product (in billions of doll
Whitepunk [10]

If one uses the data above (in billions of dollars), the Gross domestic product (in billions of dollars) for this economy equals  $1,200.

<h3>What is the GDP about?</h3>

Note that:

GDP (Gross Domestic Product):

Thus it will be :

Consumption + Investment + Government expenditure + (Export - Import)

Which is:

GDP = 800 + 200 + 300 + (100 - 200)

GDP = $1200 billions

See full question below

Consumption expenditures $800

Investment expenditures 200

Government purchases 300

Exports 100

Imports 200

Wages 800

8) Refer to Table above. Consider the data above (in billions of dollars) for an economy: Gross domestic product (in billions of dollars) for this economy equals

A) $2,200.

B) $1,600.

C) $1,400.

D) $1,200.

Learn more about GDP from

brainly.com/question/1383956

#SPJ1

6 0
2 years ago
A company wants to build a new type of spaceship for transporting astronauts to the moon. What should the company do first?
Paraphin [41]

Answer:

Think of some ideas of how their gonna create the new spaceship

Explanation:

Because I'm Smort (typo intended)

4 0
3 years ago
Read 2 more answers
Other questions:
  • If in your checkout cart right before you buy something there is an option saying "this order contains a gift." on amazon, what
    7·1 answer
  • Which one of the following parts of a universal motor does not move? A. The armature B. The field coil C. The shaft D. The commu
    5·1 answer
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • What is are motor vehicle emissions?
    8·1 answer
  • Describe five different ways databases can be processed
    14·1 answer
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • What are advantages of using document templates?
    13·2 answers
  • Also have a good day people !!
    5·2 answers
  • Add me on Fortnite. Epic is smashman892. *Ik it sux but it's an old account* Comment ur epic
    6·2 answers
  • In windows 10, where would you save the template so it is available in the available templates list in backstage view?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!