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
How do u know when a website doesnt like u?
stira [4]
Honest answer a website does not have feelings so therefore there is no way to tell if a website likes you or not!! The reason it may not load is because your IT provider or maybe to firewalls that are set up on your modem. Sometimes its not that and you just need to keep you computer up to date that way it can get on the websites! Hope i helped
3 0
3 years ago
a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
geniusboy [140]

Answer:

A power supply consists of wires connecting the cpu and other parts of the computer. The data bus transfers data between CPU and memory unit.

Explanation:

4 0
2 years ago
Rikki has had several problems at work recently. Her printer isn't printing correctly, copies from the copy machine come out wit
Ghella [55]
Create a maintenance schedule 
3 0
3 years ago
Read 2 more answers
Consider the following code segment.
mafiozo [28]

Answer:

for (int h = k; h >= 0; h--)

Explanation:

From the list of given options, option C answers the question.

In the outer loop

Initially, k = 0

In the inner loop,

h = k = 0

The value of h will be printed once because h>=0  means 0>=0 and this implies once

To the outer loop

k = 1

The inner loop will always assume value of k;

So,

h = 1

This will be printed twice because of the condition h>=0  means 1>=0.

Since 1 and 0 are >=0; 1 will be printed twice

To the outer loop

k = 2

The inner loop

h = 2

This will be printed thrice because of the condition h>=0  means 2>=0.

Since 2, 1 and 0 are >=0; 2 will be printed thrice

To the outer loop

k = 3

The inner loop

h = 3

This will be printed four times because of the condition h>=0  means 3>=0.

Since 3, 2, 1 and 0 are >=0; 3 will be printed four times

7 0
3 years ago
Who invented Satellites? What purpose does it serve? How has it impacted society today?
noname [10]

Answer:

Satellites have changed the way we experience the world, by beaming back images from around the globe and letting us explore the planet through online maps and other visuals. Such tools are so familiar today we often take them for granted. ... Satellites often offer hints about life on the ground, but not omniscience.

5 0
2 years ago
Read 2 more answers
Other questions:
  • The condition, ____, entered in the criteria row of a long text field in a query window would retrieve all records where the lon
    8·1 answer
  • Given the following class import java.util.ArrayList; public class RectangleTester { public static void main(String[ ] args) { A
    7·1 answer
  • Carlos own a hardware store.He currently is not using any software to track what he has in the store. .In one to two sentences,
    10·1 answer
  • Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read
    6·1 answer
  • What is the other name of the horizontal column graph
    9·1 answer
  • technician is dispatched to troubleshoot a user's computer. After performing diagnostics, the technician determines that drive t
    5·1 answer
  • What was used to enhance silent films of the early 1900s
    15·1 answer
  • 2. What is the name for an action performed by the VR Robot?
    7·2 answers
  • What is machine learning
    9·2 answers
  • Which of these are characteristics of a Python data type? Check all that apply.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!