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
A college team's BCS football ranking is comprised of three elements:1) the Harris Poll score, 2) the Coaches Poll score, and 3)
artcher [175]

Answer:

harris_poll_ranking = int(input("Enter team's Harris Poll ranking [1 - 2,850]: "))

coaches_poll_ranking = int(input("Enter team's Coaches Poll ranking [1 - 1,475]: "))

computer_ranking  = float(input("Enter team's computer ranking  [0 - 1]: "))

harris_poll_score = harris_poll_ranking / 2850

coaches_poll_score = coaches_poll_ranking / 1475

bcs_score = harris_poll_score / 3 + coaches_poll_score / 3 + computer_ranking / 3

print(bcs_score)

Explanation:

*The code is in Python.

Ask the user to enter the  harris_poll_ranking as int, coaches_poll_ranking as int and computer_ranking as float

Calculate the harris_poll_score, divide the harris_poll_ranking by 2850

Calculate the coaches_poll_score, divide the coaches_poll_ranking by 1475

Calculate the bcs_score, harris_poll_score, coaches_poll_score and computer_ranking by 3 and sum them

Print the bcs_score

6 0
3 years ago
What does the % find
Sever21 [200]

Answer:

The FIND function returns the position (as a number) of one text string inside another. If there is more than one occurrence of the search string, FIND returns the position of the first occurrence. FIND does not support wildcards, and is always case-sensitive.

Explanation:

4 0
2 years ago
When should you use a union type component in a structured variable?
Eduardwww [97]

Answer:

The answers to 1st question and part 2A is given. However, the 2B is not given complete and thus cannot be answered.

Explanation:

UNION is a keyword used in C Language to have a commonly shared memory that can be used by multiple elements. It is a data-type that allows different data types to use the same shared memory location.

Importance: If you want to minimize the use of memory by sharing it between different datatype variables, then use UNION. For Ex. Let's suppose I want to use 2 variables a and b of type char and int respectively. Now, suppose int takes memory space of 2 bytes and char takes 1 byte then the total amount of memory needed = 2 + 1 = 3 Bytes. But, we want to first make use of a, and once done, we want to declare variable b. We can limit the memory use by declaring a memory space of 2 bytes (max of a and b). First, we can use this space to store the int variable and when done with it, we can use it to store the char variable.

PART 2A

typedef struct{

  int partNum;

  char partName[25];

} partin;

#define Partin partin

7 0
3 years ago
(True/False) Utilizing a higher bandwidth can support a larger volume of data (in bits per second) to be transmitted than a lowe
lions [1.4K]

Answer:

True

Explanation:

Bandwidth refers to the maximum data transfer rate across the communication media it refers to the amount of information sent for unit time and it's not related to the speed at which data is transferred (latency) but rather the amount of information. As an analogy imagine a full-pipe, the width of the pipe is related to the amount of water per unit time across the pipe (bandwidth).

3 0
3 years ago
Read 2 more answers
When creating a mail merge, you must insert all of the items from your data source into your merged document. Truth or false ?
ElenaW [278]
True <----------------
3 0
3 years ago
Read 2 more answers
Other questions:
  • A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long fi
    13·1 answer
  • Which buttons should you use to publish and change a message on a message board
    6·2 answers
  • IPhone + iPad + iPod + iPod touch + iMac + MacBook + iBook + Apple =???
    11·2 answers
  • Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
    11·1 answer
  • The construction of a mixed media assemblage would be considered
    9·1 answer
  • The physical part or components of a computer system called​
    5·2 answers
  • To make something ready for some activity is to ________it.
    15·1 answer
  • Durante 10s, la velocidad de rotación y el momento de giro de las ruedas de un coche eléctrico son 100 rpm y 1405,92 Nm, respect
    13·1 answer
  • Super Scores
    11·1 answer
  • What are the 3 rules of music<br><br> ps: there is no music subject so i had to put something else
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!