#include <iostream>
using namespace std;
int main() {
int n;
cout<<"Enter an integer: ";
cin>>n;
// Checking n is zero
if(n==0){
cout<<"zero"<<endl;
}
// Checking n is greater than zero
else if(n>0){
cout<<"positive"<<endl;
}
// Checking n is less than zero
else{
cout<<"negative"<<endl;
}
return 0;
}


Write a C++ Program Write a program that prompts the user to input a number. The...
Write a C++ Program In C++, struct is a reserved word. Define the struct fruitType. Write a program that declares a variable of type fruitType, prompts the user to input data about a fruit, and outputs the fruit data. You must insert the following comments at the beginning of your program and write our commands in the middle: Write a C++ Program: /* // Name: Your Name // ID: Your ID */ #include <iostream> #include <string> using namespace std; struct...
Write a program that write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false. You must insert the following comments at the beginning of your program and write our commands in the middle: Write a C++ Program: /* // Name: Your Name // ID: Your ID */ using namespace std; #include <iostream> using namespace std; bool isVowel(char ch); int main() { char ch; … … ...
Write code that prompts the user to input a number. The program should then output the number and a message saying whether the number i "Positive, "Negative" or "Zero". It should further output whether the number is odd or even (zero is counted as even) For example:
Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. #include <iostream> #include <string> using namespace std; void removeVowels(string& str); bool isVowel(char ch);...
Write the program FindPatientRecords that prompts the user for an ID number, reads records from Patients.txt, and displays data for the specified record. If the record does not exist, display the following error message: No records found for p# using System; using static System.Console; using System.IO; class FindPatientRecords { static void Main() { // Your code here } }
Write the program FindPatientRecords that prompts the user for an ID number, reads records from Patients.txt, and displays data for the specified record. If the record does not exist, display the following error message: No records found for p# using System; using static System.Console; using System.IO; class FindPatientRecords { static void Main() { // Your code here } }
C++ Program Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is: Enter a number (<100): Enter a number (<100): Enter a number (<100): Your number < 100 is: 25 #include <iostream> using namespace std; int main() { int userInput; /* Your solution goes here */...
Write a program that prompts the user to input the x-y coordinate of a point in a Cartesian plane. The program should then output a message indicating whether the point is the origin, is located on the x ( or y ) axis, or appears in a particular quadrant. using only iostream and functions
Write a program in C++ that prompts the user to input the name of a text file and then outputs the number of words in the file. You can consider a
Write a program in Java that prompts a user for Name and id number. and then the program outputs students GPA MAIN import java.util.StringTokenizer; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { String thedata = JOptionPane.showInputDialog(null, "Please type in Student Name. ", "Student OOP Program", JOptionPane.INFORMATION_MESSAGE); String name = thedata; Student pupil = new Student(name); //add code here ...