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
1. ___________ ensures the integrity and security of data that are passing over a network.
allochka39001 [22]

Answer:

The correct answer to the following question will be Option D (Network-security protocols).

Explanation:

  • Methods and procedures for protecting network data from unwanted information retrieval are managed by network security protocols.
  • They are a network-style protocol that guarantees the protection and privacy of data in transit through a wireless connection. It describes procedures and techniques for protecting network data from every unauthorized effort to access or remove data material.

Therefore, Option D is the right answer.

5 0
4 years ago
Write a program that reads the data from rawdata_2004.txt into a dictionary whose keys are country names and whose values are pe
san4es73 [151]

Answer:

import re

def country_capita():

   #opens file

   file=open("inputfile.txt", "r")

   dictionary=dict()

   #reads line by line

   for line in file.readlines():

       # substitutes for multiple space a single space

       line = re.sub(r"[\s]{2, }", ' ', line)

       list=[]

       #splits line on space

       list=line.split(" ")

       #put into dictionary

       dictionary[list[1]]=list[2]

#   get input

   while True:

       choice=input("Enter the country name or quit to exit: ")

       if choice=="quit":

           break

       elif choice in dictionary.keys():

           print(dictionary[choice])

       else:

           print("Invalid Country")

country_capita()

Explanation:

Using python to code this program. First we, (line 1) import the re module which offers us a set of functions that allows us to search a string for a match. ((line 2) Next we define a function country_capita() that will open rawdata_2004.txt, read the information within line by line and create a dictionary list. The we create a while loop with conditional statements that prompt the user to enter country names, print the corresponding values and stops when the user enters quit.

7 0
3 years ago
Your company wants to use an IoT device but wants to make sure it does not interfere with other RF devices that use the 2.4 GHz
Karo-lina-s [1.5K]

Answer:

Option 3 i.e., Z-Wave.

Explanation:

The Z-Wave device should be purchased by the company because It is a standard for connectivity, used mainly for smart home devices that use the 2.4 GHz RF band and this is also that device which the company wanted for the 50 meters away from the base station.  

So, It is a device should be purchased by the company.

Other options are incorrect because those devices not accomplish the following requirements.

7 0
3 years ago
What is the proper name for C4D5?<br> O cell<br> column<br> Orange<br> Orow
babunello [35]
Range. If you are referring to the Excel Format, this is a range.
3 0
3 years ago
Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
Vikki [24]

The statement “All queries have only one intent: Know, Do, Website or Visit-in-Person intent” is True.

The statement “The intent of a Do query is to accomplish a goal or engage in an activity on a phone” is True.

The statement “The intent of a Website query is to find information” is True.

The statement “There is absolutely no information about who is responsible for the content of the website on a YMYL topic” is True.

The statement “All the Main Content(MC) of the page is copied and created with deceptive intent” is True.

The statement “A page with a mismatch between the location of the page and the rating location; for example, an English page for an English rating task’ is True.

“A file type other than a web page, for example; a PDF, a Microsoft Word document or a PNG file” is False.

<u>Explanation:</u>

The searcher tries to find out the Know queries. The action is taken by the searcher using the Do queries. The searcher looks for a site/ page using Website queries. The queries which are the same as they appear to be are Visit-in-Person queries.

The statement is true because in Do queries, the action is taken like the control of the smartphone is given to Google.

The search for a page or a site takes place using Website queries.

It is not always true that the Wikipedia pages should get high ratings for all user intents because information is helpful.

There is no surety that who will update the content of the website on a YMTL topic.

The Main Content (MC) of the low quality YMYL page helps the page to achieve its purpose. For YMYL the content is created with deceptive intent. The pages manipulate users to take action which will not help the users .

The PQ rating is lowest when there is a mismatch between the location of the page and the rating location, for example, an English rating task. Here, the purpose of the page is required to be understood to determine the rating.

The PQ rating is not determined by the type of the page but by the purpose of the page.

6 0
4 years ago
Other questions:
  • What is requirement analysis
    8·1 answer
  • Stella is a bank executive. She is preparing a spreadsheet on the loan repayment schedules of customers. Which function can she
    9·1 answer
  • A systems analyst draws a lifeline with an X at the end. This lifeline represents _____.a. a message that cannot be deliveredb.
    9·2 answers
  • Write code which takes inputs and creates two Rectangle objects (using the edhesive.shapes.Rectangle class) and compares them us
    7·1 answer
  • What is the foundational domain for business
    12·1 answer
  • . What process skill would a scientist use to find the length of a line
    5·1 answer
  • Write a program to input 100 students marks and find the highest marks among the them​
    12·1 answer
  • Ishmael would like to capture a selected potion of his screen and then capture action he performs on that selected portion. What
    5·1 answer
  • Plz help me I need help​
    6·1 answer
  • A(n) ______is like an intranet except it shares its resources with users from a distant location. Select your answer, then click
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!