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
Give brainliest if you tell me the can tell me the most random thing
Scorpion4ik [409]

Mood

Explanation:

Because it gets changed by the time you are happy or sad. Same that while you are reading if you like your. mood gets good but if you dont find this ans satisfied your mood gets changed.

3 0
3 years ago
When was the phone Built
quester [9]
The first phone was made in 1854 by <span>Antonio Meucci.

Other inventors like </span>Johann Philipp Reis, <span>Alexander Graham Bell, Elisha Gray, and Thomas Edison reinvented the telephone or enhanced it.</span>
3 0
3 years ago
Read 2 more answers
Supplemental security software (such as anti-virus [anti-malware]) is: Generally considered essential for all desktops and lapto
k0ka [10]

Answer:

Explanation:

With an anti-virus, we can search, detect, and delete malware like spyware, worms, Trojans, rootkits, pseudoviruses, etc.

An anti-virus can detect virus with several methods like:

  • Digital signature
  • Heuristic detection
  • Behavior detection
  • Sandbox detection

Is necessary for personal laptops and desktops, even in companies hardware.

7 0
3 years ago
The cost of a CLEP exam is about__<br><br> A$100 <br> B $50 <br> C$80<br> D$170
Elanso [62]

Your answer is C or $80

When averaging the costs of credit hours at public and private community colleges and four-year institutions, the median cost for a three-hour class in 2017 was $1,782. Conversely, each CLEP exam costs $85.

5 0
3 years ago
Read 2 more answers
Assignment Guidelines
kompoz [17]

Answer:

Explanation:

so u have to be smart

5 0
2 years ago
Other questions:
  • What are smart mobile devices
    11·1 answer
  • 6. While using the HTS, ________________ will help maintain a safe driving environment despite high speeds and a large number of
    12·1 answer
  • What is the process called that occurs when you start up your computer? A Download B Restore C Boot D Copy
    10·2 answers
  • Which type of image is not a supported using the Online Pictures or Insert Picture command?
    5·2 answers
  • An incurred cost that cannot be recovered, which is irrelevant for all decisions about the future, is included in the projected
    14·1 answer
  • Write a program in C which asks the user for 10 integers and prints out the biggest one.
    10·1 answer
  • Retype and run, note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks.
    9·1 answer
  • Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }
    7·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
  • To conserve its public IP addresses, a company can instead use ____ addresses for devices within its own network boundaries.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!