8.6 (Displaying Strings in Alternating Uppercase and Lowercase) Write a program that inputs a line of text into char array s[100]. Output the line in alternate uppercase letters and lowercase letters.
Q: 11. Write code that reproduces the output shown below. 1]: # Code Here 2]: # DON'T WRITE HERE 2]:…
A: Explanation: This is the array that transforms sequences of sequences into two-dimensional arrays.…
Q: 5. Assume that an integer array m is defined by the following statements: int m[2][5]={{1,8,7,6,10),…
A:
Q: Write a program to store the above 3 class scores in Jagged Array by initialing all these values ,…
A: A Jagged Array is an array which is a two dimensional array where the columns changes from one row…
Q: 5.3) Write a C++ program to replace all 3-digit numbers in the array given below with a random…
A:
Q: (Converting Strings to Integers for Calculations) Write a program that inputs six strings t hat…
A: Since you have not mentioned the sample output, so we have provided the output in the most…
Q: 11.16 LAB: Reverse a string Write a recursive function called ReverseString() that takes in a string…
A: Answer
Q: 3.27 LAB: Login name Write a program that creates a login name for a user, given the user's first…
A: The answer is given below.
Q: 11. Write code that reproduces the output shown below. In [11]: # Code Here In [12]: # DON'T WRITE…
A: In this question we have to write a python code to generate a array using numpy. Question 11. Write…
Q: 10.25 LAB: Quadratic formula Implement the quadratic_formula() function. The function takes 3…
A: The above code is solved using Python Language below:
Q: 7.12 Write a program that simulates the control software for a "people mover" system, a set of…
A: The program is given N amount of trains and M amount of stations in a text file; followed by the…
Q: int i = 0; i < a.ler [1] = a[(a[i] + 3)
A: Dear Student, Here array a contains 5 elements thus length of a is 5 and a.length is 5 , based on it…
Q: Exercise#1: Write a complete C++ code that creates an integer array of 10 elements. Use a loop to…
A: Your C++ program is given below as you required with an output.
Q: 7. Implement the complex number ADT in C++ using a class. The complex ADT is used to represent…
A: Note: As you have asked multiple part questions, as per our policy, we will solve the first three…
Q: 5) int x; x=10,20,30; cout<<x<<endl;
A: Coded using C++.
Q: 10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+…
A: Program to find the number of students who got A+, B+ and the number of students who just passed.
Q: HW5-4) Write and test a function that fetches the next n characters from input (including blanks,…
A: Answer
Q: int i, j; for(i=3, j=4 ; i>10; --i,j--) { } printf("%d and %d", i, j);
A:
Q: (7) Implement the ShortenSpace() function. ShortenSpace() has a string parameter and updates the…
A: Programming language is missing in the question. The below program is provided in C language. If you…
Q: After the break statement in (a) is executed in the following loop, which statement is executed?…
A: First Program: In C++, the break statement is mentioned inside the loop, and when the break…
Q: 10.9 (Using Unions) Create union floatingPoint with members float f, double d and long double x.…
A: The program is written in c
Q: 1. Write a program that take an Alphabet C (C can be uppercase or lowercase) as input and print all…
A: i give this question answer in next step
Q: Define a method named swapValues that takes an array of four integers as a parameter, swaps array…
A: import java.util.Scanner; public class LabProgram { public static void swapValues(int[]…
Q: Q1/ write a c++ program to find the value of array C from add array A and array B?use (five number)…
A: Given: Sum of positive Integers Sum of two Arrays
Q: public class Turn{public static void main(String[] args){// Different initial values will be used…
A: Equations that are used to replace the value of variable x and y: - The initial values of the…
Q: 3. Write C++ statements to define and initialize the following arrays. a. Array heights of 10…
A: array declaration and initialization in c++ syntax is data_type…
Q: Printing array elements separated by commas. Write a for loop to print all NUM_VALS elements of…
A: The given below program is in java
Q: Assume bool foundPair and int pairCount are both declared and have valid values. if (foundPair)…
A: Here foundPair is boolean variable so it can hold either true or false value. The if statement in…
Q: 6.10 (Sales Commissions) Use a single-subscripted array to solve the following problem: A…
A: Dear Student, The source code of the program is given below. The program has been Implemented using…
Q: Write a VB.NET program to read elements in an array and find the sum of array elements.
A: 1- In this assignment require, read array element and calculate the sum of all the array element. 2-…
Q: Q1. Write a program to do the following : (1) Declare an array a of size 10 and three pointer…
A: Hello Student. Greetings from my side. Hope you are doing great. I will try my best to answer your…
Q: using chapters 1 to 10 from the book C how to program edition 8
A: #include <stdio.h>union integer{ char c; short s; long b; int i;};int main(void){…
Q: (Counting the Number of Words in a String) Write a program that inputs several lines of t ext and…
A: A C program is as follows, File name: “main.c” #include <stdio.h> #include <string.h> //…
Q: 7.17) Write the inOrder() method, which has an array of integers as a parameter, and returns true…
A: Given: Write the inOrder() method, which has an array of integers as a parameter, and returns true…
Q: Declare and initiate a float type array of A[ ]. then create another float type array B[ ].find the…
A: Note :- As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Q 26 ) Consider the following code and answer the questions. int ary[] = {5, 9, 4, 2, 6, 7,…
A: A) Starting index of ary is : 0 ( as, every array starts with index 0 ). B) last index of ary…
Q: 1 äböi In the following program, the output value is (3). #include void main( ) { int…
A: Answer: When we run the given program it will give the output 3 #include <iostream> using…
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: 1 int[] a = new int[n]; 2 a[0] = 0; a[1] = 1; 3 int x = 0; 4 for (int i = 2; i < n; i++) { 5 x =…
A: public class Main{ public static void main (String[] args) { int n = 10; int[] a…
Q: 5.28 LAB: Convert to binary - functions Write a program that takes in a positive integer as…
A: Since, here no programming language is specified so, we are providing the solution in the python…
Q: 6.5 For each of the following write a. Create a list of the first 10 multiples of 13 (from 13 to…
A: Python program for list comprehension: # List comprehension of first 10 multiples of 13 multiples =…
Q: 21.7 LAB: Login name (Use python) Write a program that creates a login name for a user, given the…
A: name = input("Input: ") lst = name.split(" ") #lst[0] = first name, lst[1] = last name, lst[2] =…
Q: 7. Write a function that evaluates the area of a pentagon. Use "math.pi", for pi, and "math.sqrt"…
A: Area of pentagon Pentagons can be convex or concave, regular or irregular. One with equal sides and…
Q: а1.1. Write a NumPy program to get the following array by using loops Output: array([[ 1, 2, 3, 4,…
A: Note: Answering the first three subparts as per the guidelines. The question is about the usage of…
Q: 1. Examine the following code segment. What will be printed?If there are any errors indicate the…
A: The given C++ code segment is: int a[8] ={16, 12, 10, 7, 15, 18, 17, 29}; int *ptr ; ptr = & a[…
Q: Assume we have two arrays (al and a2) that already declared and initialized. int al[] = {1, 2, 3, 4,…
A: Required:
Q: 15. Let C be the set of all Circles in the world, and S be the set of all Squares in the world. Vx E…
A: In questions with many questions, we must answer first one
Q: Implement Exercise 8-13 using single-dimensional parallel arrays. (8-13: Write a program to…
A: EXPLANATION: - void readFile(ifstream& infile,string names[],double scores[][5],int& n): -…
8.6 (Displaying Strings in Alternating Uppercase and Lowercase) Write a program that inputs a line of text into char array s[100]. Output the line in alternate uppercase letters and lowercase letters.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- **11.18** Java Solve (ArrayList of Character) Using the following header, create a method that produces an array list of characters from a string: toCharacterArray public static ArrayListCharacter> (String s) ToCharacterArray("abc"), for example, returns an array list containing the characters 'a', 'b', and 'c'.13.16.1: Overload salutation printing. Complete the second PrintSalutation function to print the following given personName "Holly" and customSalutation "Welcome":Welcome, Holly End with a newline. #include <iostream>#include <string>using namespace std; void PrintSalutation(string personName) { cout << "Hello, " << personName << endl;} // Define void PrintSalutation(string personName, string customSalutation)... /* Your solution goes here */ int main() { PrintSalutation("Holly", "Welcome"); PrintSalutation("Sanjiv"); return 0;}3.6.5: Printing array elements separated by commas. Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp = {90, 92, 94, 95}, print:90, 92, 94, 95 Your code's output should end with the last element, without a subsequent comma, space, or newline.
- 6.17 LAB: Swapping variables Define a method named swapValues that takes an array of four integers as a parameter, swaps array elements at indices 0 and 1, and swaps array elements at indices 2 and 3. Then write a main program that reads four integers from input and stores the integers in an array in positions 0 to 3. The main program should call function swapValues() to swap array's values and print the swapped values on a single line separated with spaces.8.16 (Searching for Substrings) Write a program that inputs a line of text and a search string from the keyboard. Using function strstr, locate the first occurrence of the search string in the line of text, and assign the location to variable searchPtr of type char *. If the search string is found, print the remainder of the line of text beginning with the search string. Then, use strstr again to Locate the next occurrence of the search string in the line of text. If a second occurrence is found, print the remainder of the line of text beginning with the second occurrence. [Hint: The second call to strstr should contain searchPtr + 1 as its first argument.] Solve without using pointers6. using c++, Write a function that counts the number of times an integer t occurs in an array of integers.
- (7) Implement the ShortenSpace() function. ShortenSpace() has a string parameter and updates the string by replacing all sequences of 2 or more spaces with a single space. ShortenSpace() DOES NOT output the string. Call ShortenSpace() in the PrintMenu() function, and then output the edited string. Ex: Edited text: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue!3. Write C++ statements to define and initialize the following arrays. a. Array heights of 10 components of type double. Initialize this array to the following values: 5.2, 6.3, 5.8, 4.9, 5.2, 5.7, 6.7, 7.1, 5.10, 6.0. b. Array weights of 7 components of type int. Initialize this array to the following values: 120, 125, 137, 140, 150, 180, 210. c. Array specialSymbols of type char. Initialize this array to the following values: '$', '#', '%', '@', '&', '!', '^'. d. Array seasons of 4 components of type string. Initialize this array to the following values: "fall", "winter", "spring", "summer".11.10 LAB: All permutations of names Write a program that lists all ways people can line up for a photo (all permutations of a list of strings). The program will read a list of one word names (until -1), and use a recursive method to create and output all possible orderings of those names, one ordering per line. When the input is: Julia Lucas Mia -1 then the output is (must match the below ordering): Julia Lucas Mia Julia Mia Lucas Lucas Julia Mia Lucas Mia Julia Mia Julia Lucas Mia Lucas Julia #include #include #include main.cpp: using namespace std; // TODO: Write method to create and output all permutations of the list of names. void AllPermutations(const vector &permList, const vector &nameList) { } int main(int argc, char* argv[]) { vector nameList; vector permList; string name; // TODO: Read in a list of names; stop when -1 is read. Then call recursive method. return 0; }
- 8.19 (Removing a Particular Word From a Given Line of Text) Write a program that inputs a line of text and a given word. The program should use string library functions strcmp and strcpy to remove all occurrences of the given word from the input line of text. The program should also count the number of words in the given line of text before and after removing the given word using the strtok function. Solve it Without using pointers5.28 LAB: Convert to binary - functions Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string. Ex: If the input is: 6 the output is: 110 Your program must define and call the following two functions. The IntegerToReverseBinary() function should return a string of 1's and 0's representing the integer in binary (in reverse). The ReverseString() function should return a string representing the input string in reverse. string IntegerToReverseBinary(int integerValue)string ReverseString(string userString)6.8 In Python, An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is: Institute of Electrical and Electronics Engineers the output is: IEEE