i need help determining the output for these problems
Cout << (3 + count) << “ “ ;
________________
While ( I <= 10)
{
If ( I > 5 && i ! = 9)
Cout << ‘x’ ;
I++;
}
____________________
cout << a [0] << “ “ << a [1] << “ “ << a[2] << endl;
a[1] = a[2];
cout << a [0] << “ “ << a [1] << “ “ << a [2] << endl;
_________________________
Char Name{10];
Strncpy(Name,Mystring,,2);
Cout<
Cout<
__________________________
char next;
Do
{
cin.get(next);
cout << next;
} while ( (! Isdigit(next) ) && (next 1 = ‘\n’) );
Cout << “
If the dialogue begins as follows, what will be the next line of output?
Enter a line of output;
I’ll see you at 10:30 AM.
________________________________
int count = 0;
cout << “ Enter a line of input: \ n”;
cin. Get (next);
While (next != ‘\n\ )
{
If ((count % 2) ==0)
cout << next;
Count ++;
cin.get(next);
}
1 Ans)
For ( int count = 1; count < 30; count+=9)
Cout << (3 + count) << “ “ ;
Initally,
count = 1
print 3+count = 4
count += 9 => count = 10
print 3+count = 13
count += 9 => count = 19
print 3+count = 22
count += 9 => count = 28
print 3+count = 31
count += 9 => count = 37
since count is greater than 30 exit the loop

2 Ans)
int I = 1;
While ( I <= 10)
{
If ( I > 5 && i ! = 9)
Cout << ‘x’ ;
I++;
}
Initally, I = 1
Since I <= 10, get into loop
I > 5 is false
Since I <= 10, get into loop
I > 5 is false
I++ => I = 2
Since I <= 10, get into loop
I > 5 is false
I++ => I = 3
Since I <= 10, get into loop
I > 5 is false
I++ => I = 4
Since I <= 10, get into loop
I > 5 is false
I++ => I = 5
Since I <= 10, get into loop
I > 5 is false
I++ => I = 6
Since I <= 10, get into loop
I > 5 and I != 9 are true so print(x)
I++ => I = 7
Since I <= 10, get into loop
I > 5 and I != 9 are true so print(x)
I++ => I = 8
Since I <= 10, get into loop
I > 5 and I != 9 are true so print(x)
I++ => I = 9
Since I <= 10, get into loop
I > 5 is true and I != 9 is false
I++ => I = 10
Since I <= 10, get into loop
I > 5 and I != 9 are true so print(x)
I++ => I = 11
Since I <= 10 false terminate loop

3 Ans)
double a [3] = {1.1, 2.2, 3.3};
cout << a [0] << “ “ << a [1] << “ “ << a[2] << endl;
a[1] = a[2];
cout << a [0] << “ “ << a [1] << “ “ << a [2] << endl;
print a[0] which is 1.1 ,a[1] which is 2.2, a[2] which is 3.3
now a[1] = a[2] means a = {1.1,3.3,3.3}
print a[0] which is 1.1 ,a[1] which is 3.3, a[2] which is 3.3

4 Ans)
strncpy copies one string to another with mentioned number of characters here we are copying 2 characters of Mystring which is He so, name contains "He"
5 Ans)
The input is taken until the character is not a digit or new line here in input it prints up to it gets 1 in 10:30
The output is : I'll see you at 1

6 Ans)
It takes the string character by character with 0-indexing and prints even indexed characters

i need help determining the output for these problems For ( int count = 1; count...
This is for a C++ program: I'm almost done with this program, I just need to implement a bool function that will ask the user if they want to repeat the read_course function. I can't seem to get it right, the instructions suggest a do.. while loop in the main function. here is my code #include <iostream> #include <cstring> #include <cctype> using namespace std; const int SIZE = 100; void read_name(char first[], char last[]); void read_course(int & crn, char des[],...
Given the following function: int fun1(int count){ int Num ; for (i = 0; i < count; ++i) { cin >> Value; if (i == 0) Num = Value; else if (Value > Num) Num = Value; } return Num ; } What is the output of the following C++ code segment if the following list is entered? (Input list: 5 -15 -90 -2 -60 -30) int Num = 0 , Value, numValues; cin >> numValues; if (numValues > 0) cout...
#include <fstream> #include <iostream> #include <cstdlib> using namespace std; // Place charcnt prototype (declaration) here int charcnt(string filename, char ch); int main() { string filename; char ch; int chant = 0; cout << "Enter the name of the input file: "; cin >> filename; cout << endl; cout << "Enter a character: "; cin.ignore(); // ignores newline left in stream after previous input statement cin.get(ch); cout << endl; chcnt = charcnt(filename, ch); cout << "# of " «< ch« "'S:...
Am I getting this error because i declared 'n' as an int, and then asking it to make it a double? This is the coude: #include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include <algorithm> #include <vector> using namespace std; void sort(double grades[], int size); char calGrade(double); int main() { int n; double avg, sum = 0;; string in_file, out_file; cout << "Please enter the name of the input file: "; cin >> in_file; ...
C++ language I need to update this code with the following: ask the user for how many structures they would like. Once you get the number, allocate an array of pointers. Once they have been created, proceed to loop through and get the data as usual, and display it back to the screen. struct record { int age; string name; }; int check(record r[], int n, string nm) { for (int i = 0; i < n;...
Need help with a C++ program. I have been getting the error "this function or variable may be unsafe" as well as one that says I must "return a value" any help we be greatly appreciated. I have been working on this project for about 2 hours. #include <iostream> #include <string> using namespace std; int average(int a[]) { // average function , declaring variable int i; char str[40]; float avg = 0; // iterating in...
Hello I need a small fix in my program. I need to display the youngest student and the average age of all of the students. It is not working Thanks. #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> using namespace std; struct Student { string firstName; char middleName; string lastName; char collegeCode; int locCode; int seqCode; int age; }; struct sort_by_age { inline bool operator() (const Student& s1, const Student& s2) { return (s1.age < s2.age); // sort...
-can you change the program that I attached to make 3 file
songmain.cpp , song.cpp , and song.h
-I attached my program and the example out put.
-Must use Cstring not string
-Use strcpy
- use strcpy when you use Cstring: instead of this->name=name
.... use strcpy ( this->name, name)
- the readdata, printalltasks, printtasksindaterange,
complitetasks, addtasks must be in the Taskmain.cpp
- I also attached some requirements below as a picture
#include <iostream>
#include <iomanip>
#include <cstring>
#include <fstream>...
C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...
c++
Implement the following function: 1) Name: ProcessLine a. Parameters: Int 10 character array line, charc b. Job: The function will modify line such that every occurrence of c is replaced by a "*". It will also return the count of c in line. The main() function is provided. You only need to implement the function Processline. #include <iostream> #include <string> using namespace std; int main() char line 200), c; int Count; { cout<<"Enter some text: "; cin.get(line, 200); cout<<"Enter...