(b) Write a program that takes a string from the user and calculates the number of vowels, consonants, digits and white-spaces.
Q: Write code to calculate no of letters and digits in a string.
A: Here not mentioned the language so we write code in python:…
Q: Write C code to split an input string (variable “name”) into two output strings (variables “first”…
A: #include<stdio.h>//logic to solve this problem is//take two variables to store first and…
Q: Q9: Write C++ program to reads a character and print if it is digit (0..9), caplia letter (A,B, ...…
A: - Declaring header file -Declaring Variables -Getting the input entered by user -Inside If...else…
Q: Can you describe situations in which it might be necessary to trim leading or trailing characters…
A: The complete answer is given below .
Q: 16. Write a C++ program to create a random string formed using lowercase alphabets only. Input the…
A: Coded usign C++.
Q: (ix) Prompt the user to enter a string in which two words are separated by the character '+' and the…
A: The following code will accept the command line arguments and provide you the required output.
Q: Q18: Write a program in C++ to find the area of a circle.
A: #include <iostream> using namespace std; int main(){ float area,r; cout<<"Enter…
Q: Prompt the user to enter a string and write a program to take input the string and find the length…
A: According to the Question below the solution: Output:
Q: 5. Read input a string from the user and compute the count of characters '+' and '-' in the output.
A: Write a C++ program to read input a string from the user and compute the count of characters '+' and…
Q: Problem The program takes in two strings and display the larger string without using built-in…
A: Note: As the programming language is not mentioned. So we did the question using PYTHON programing…
Q: iv) Input a string str from the user. Write a C++ program, to replace all the occurrences(if any) of…
A: In this program we have to write a C++ program which will replace a substring to a another string.…
Q: d) Read input two strings stx1, stx2 from the user and form a new string by concatenating the…
A: Given Read input two strings stx1, stx2 from the user and form a new string by concatening the…
Q: 1.3 Read input a string from the user, add the string "JPCA" at both the start and end of the string…
A: Write a C++ program to read input a string from the user, add the string "JPCA" at both the start…
Q: 11. Write a C++ program to read a string value and then add the string "aeiou" at the front and end…
A: Write a C++ program to read a string value and then add the string "aeiou" at the front and end of…
Q: User enters a string that contains only 0,1,2. Write a program in CPP to take input the string from…
A: Required:- Approach:- Take the string and count each character from it and print the greatest one.…
Q: Q9: Write C++ program to reads a character and print if it is digit (0..9), capital letter (A,B, ...…
A: The programming methodology for the given program is given by: Including header files Main function…
Q: Question #1: Write a VB program that takes as input a string and displays the st: with every even…
A: VB Code: Imports System.Text Public Class Form1 Private Sub Button1_Click(sender As Object, e As…
Q: Write a Python regular expression to replace all white space with # in given string “Python is very…
A: algorithm read a string . here it is “Python is very simple programming language.” take ch as a…
Q: C program to read 10 characters from user and print it as a string
A: NOTE :- Below i attached the runnable code of that by which you understand it well.
Q: Q8: Write C++ program to read an integer from 1 to 12, and print out the value of the corresponding…
A: C++ Code: #include <iostream> using namespace std; // here is the main function int main(){int…
Q: 7. Read input a string from the user and compute the sum of the count of characters '(' and ')' in…
A: #include <iostream> #include <conio.h> #include <stdio.h> using namespace std; int…
Q: Write c++ program to reads a character and print if it is digit (0..9), capital…
A: Program: #include<iostream> //Declaring Header file using namespace std; int main () {…
Q: Write a program to read character value from user until the character '.' is entered from the user.…
A: To keep taking input from the user until the terminating character (.) is entered, use a while loop,…
Q: 7. Make a program that will convert an inputted number in inches (in.) and display its equivalent…
A: The problem is based on the basics of C programming language.
Q: Swap the second and second last character of the string given below using a C++ program and print…
A: Given String: "Question2" Requirement: Write a program in C++ to swap the second and second last…
Q: 1 – Write a python program that prompts the user to enter a string and checks if the string contains…
A: Pyhton program: string=input("Enter string: ")vowels=0for i in string: if(i=='a' or i=='e' or…
Q: 8. Write a C# Sharp program to determine whether a string ends with a particular substring.
A: code snippet:
Q: Complete the given program code that will ask the user to enter some string and display the vowels…
A: solution in below step
Q: Use python and write a function that takes a number as an input argument and returns True if the…
A:
Q: 11. In C++ write a program to input a string and then create a new string in which the first and the…
A: In C++ write a program to input a string and then create a new string in which the first and the…
Q: Take input a string form user and increment every character of that string by 2. Print the string…
A: Algorithm : Step 1 : declare the required variables and array. Step 2 : use do loop to read the…
Q: 1. Write a program that accepts three strings as input, then shows the first character of each…
A: string1 = input("Enter 1st string: ")string2 = input("Enter 2nd string: ")string3 = input("Enter 3rd…
Q: d) Print the string "Assignment 3 Rust Programming" 10 times in the output with only one string in…
A: Since no programming language is mentioned, I am using Rust programming language. Algorithm: Start…
Q: program to read integer number and print equivalent string
A: program to read integer number and print equivalent string
Q: Write a program to generate the following pattern by initializing the string at first PROGRAMMING…
A: required: C program to print the following pattern. all the required code with screenshots is given…
Q: b) Which Python f-string expression will format an integer called ex1 as 4 digits, padded with…
A: Based on python
Q: 1- Write a C++ program to ask the user to enter their first and last name and save them in a string.
A: #include <iostream> using namespace std; int main() { //create variable to hold…
Q: Question 4 Complete the following program to input some characters from keyboard (Until the input…
A: #include<stdio.h>int letters(char *ch){ int c=0; for(int i=0;ch[i]!='\0';i++) {…
Q: Write code to input a sentence from the user and output the number of characters in the sentence as…
A: Given :
Q: 2. A color code is in form of a string in which the first three characters are the code for the…
A: The solution to the given problem is below.
Q: LAB Work Write a MATLAB program that enter a string (INFORMATION Engineering College 2002) and…
A: Matlab code :- fprintf("Enter a string : ");e=input('PROMPT');fprintf("\nASCII Values of given…
Q: f) Read a string s and a char ch from the keyboard and replace all occurrences of the first…
A: Write a JAVA program to read a string s and a char ch from the keyboard and replace all occurrences…
Q: 11. Read input a string str from the keyboard and create a new string in which every character of…
A: Write a C++ program to read input a string str from the keyboard and create a new string in which…
Q: 2. You have to write a program to input two strings x2, x2 from the user and print the string x1x2…
A: Required:- 2. You have to write a program to input two strings X1, and X2 from the user and print…
Q: Write C++ program to reads a character and print if it is digit (0..9), capital letter (A,B, … ,Z)…
A: Write C++ program to reads a character and print if it is digit (0..9), capital letter (A,B, … ,Z)…
Q: Question 5) Answer A and B. A- Write a program to check the entered number by user whether it is…
A: A number is said to be positive if the number is greater than or equal to 1. Similarly, a number is…
Q: Given a string inside main function, write another function called from main and takes the string as…
A: Given: A string inside main function. Requirement: Write a function that takes the string as…
Q: d) Read input two strings p, z from the user and print the string having more number of lowercase…
A: I give the code in c++ along with output and code screenshots.
Step by step
Solved in 4 steps with 2 images
- (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard into an array named grade. The grades are to be counted as they’re read, and entry is to be terminated when a negative value has been entered. After all grades have been input, your program should find and display the sum and average of the grades. The grades should then be listed with an asterisk (*) placed in front of each grade that’s below the average. b. Extend the program written for Exercise 1a to display each grade and its letter equivalent, using the following scale: Between90and100=AGreaterthanorequalto80andlessthan90=BGreaterthanorequalto70andlessthan80=CGreaterthanorequalto60andlessthan70=DLessthan60=F(Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers input from the keyboard or assigned by the program. Then write a function named split() that reads the array and places all zeros or positive numbers in an array named positive and all negative numbers in an array named negative. Finally, have your program call a function that displays the values in both the positive and negative arrays. b. Extend the program written for Exercise 6a to sort the positive and negative arrays into ascending order before they’re displayed.(Data processing) a. Write a program to input 10 integer numbers in an array named fmax and determine the maximum value entered. Your program should contain only one loop, and the maximum should be determined as array element values are being input. (Hint: Set the maximum equal to the first array element, which should be input before the loop used to input the remaining array values.) b. Repeat Exercise 8a, keeping track of both the maximum element in the array and the index number for the maximum. After displaying the numbers, print these two messages (replacing the underlines with the correct values): The maximum value is: ___ This is element number ___ in the list of numbers c. Repeat Exercise 8b, but have your program locate the minimum of the data entered.
- (Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three rows and five columns. This array currently contains test voltages of an amplifier. Write a C++ program that interactively inputs 15 array values, and then determines the total number of voltages in these ranges: less than 60, greater than or equal to 60 and less than 70, greater than or equal to 70 and less than 80, greater than or equal to 80 and less than 90, and greater than or equal to 90. b. Entering 15 voltages each time the program written for Exercise 7a runs is cumbersome. What method could be used for initializing the array during the testing phase? c. How might the program you wrote for Exercise 7a be modified to include the case of no voltage being present? That is, what voltage could be used to indicate an invalid voltage, and how would your program have to be modified to exclude counting such a voltage?(Practice) a. Write output statements using cout that can be used to display values from the first, third, and seventh elements of each array declared in Exercise 2. b. Write a for loop that can be used to display values for the complete array declared in Exercise 2.(Practice) a. Write a declaration to store the string "This is a test" in an array named strtest. Include the declaration in a program to display the message using the following loop: for( i=0;iNUMDISPLAY;i++)coutstrtest[i]; NUMDISPLAY is a named constant for the number 14. b. Modify the for statement in Exercise 5a to display only the array characters t, e, s, and t. c. Include the array declaration written in Exercise 5a in a program that uses a cout statement to display characters in the array. For example, the statement cout << strtest; causes the string stored in the strtest array to be displayed. Using this statement requires having the end-of-string marker, \0, as the last character in the array. d. Repeat Exercise 5a, using a while loop. (Hint: Stop the loop when the \0 escape sequence is detected. The expression while (strtest[i]!=0)canbeused.)
- (Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.(Electrical eng.) Write a program that specifies three one-dimensional arrays named current, resistance, and volts. Each array should be capable of holding 10 elements. Using a for loop, input values for the current and resistance arrays. The entries in the volts array should be the product of the corresponding values in the current and resistance arrays (sovolts[i]=current[i]resistance[i]). After all the data has been entered, display the following output, with the appropriate value under each column heading: CurrentResistance VoltsProgram type C Write code that will fill the array a (declared below) with numbers typed in at the keyboard. Each line refers to an individual student’s quiz grades. So, there are 4 students with 3 grades that can entered through the keyboard. (The grades are out of 10)int a[4][3];For this assignment, create a function that calculates the average of a 1-d array and returns that average. Call this function multiple times to find averages across all rows and columns.Store each student’s quiz grades in an array called st_ave.Also store average of each quiz across all 4 students in another array called quiz_ave.Print all the information in a format that resembles the gray boxes below.
- C++The program asks for the number n. Next, we enter n numbers and store all entered numbers into an array. You need to input only two "zero" numbers.The program should display the sum of all numbers that are located between zeros.Input:106 19 0 -3 4 8 0-6 9 5Output: 9Note: Numbers between two zeros are -3, 4 and 8. And their sum equal to -3+4+8=12Greate a function for this task in this way:int sum_between_zeros(int a[], int size){}c++ Below, write the code of the program that calls the desired functions in the main function and performs the desired operations. a) random (random number range should be set to be in the range of 5-15) 10 an integer with an element produces numbers and transfers them to an array called array A and displays them enter a function that prints. b) then this sequence takes the arithmetic mean of the elements of the sequence A,round the found average value to the nearest large integer and return it to variable A.enter a function that assigns and prints the variable A on the screen. c) then write a function that finds the factorial of the variable A value and assigns it to factorial A and prints it on the screen5. Write a function which will find the average of all elements of an array of integers. Pass an array and a dimension (the number of elements), and return the value of the average as a float ( the return value). Test this function in the main program with the array: 5, 7, 3, 5, 6, 4.