Solution In C++ #include <iostream> using namespace std; int main(){ // declaraing the variables to take input // and to store the values in "m" and "km" double length_cm; double length_m; double length_km; cout<<"Convert centimeter into meter and kilometer : \n"; cout<<"---Read more
Solution In C++
#include <iostream>
using namespace std;
int main(){
// declaraing the variables to take input
// and to store the values in "m" and "km"
double length_cm;
double length_m;
double length_km;
cout<<"Convert centimeter into meter and kilometer : \n";
cout<<"------------------------------------------- \n";
cout<<"Input the distance in centimeter : ";
// Taking the input in centimeter
cin>>length_cm;
// calculating the length in m
// as 1m = 100 cm
length_m = length_cm/100;
// calculating the length in km
// using meter length calculated above
// as 1km = 1000 m
length_km = length_m/1000;
//printing the length in meter and kilometer
cout<<"The distance in meter is: "<<length_m<<"\n";
cout<<"The distance in kilometer is: "<<length_km<<"\n";
}
Use Offline IDE like Sublime, VScode , IntelliJ to run this code. package sikshapath; //create your own package import java.util.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Scanner; class EmailId { String domainID,username,password; EmailId() { domainIDRead more
Use Offline IDE like Sublime, VScode , IntelliJ to run this code.
package sikshapath; //create your own package
import java.util.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Scanner;
class EmailId
{
String domainID,username,password;
EmailId()
{
domainID="K7";
username="K";
password="constructc000";
}
EmailId(String user,String pass,String domID)
{
domainID=domID;
username=user;
password=pass;
}
public static void main(String[] args) {
String user,pass, domID;
int p=-1,up=-1,u=-1,d=-1;
EmailId obj=new EmailId();
Scanner sc= new Scanner(System.in);
System.out.println("Enter username: ");
user=sc.nextLine();
System.out.println("\nEnter password: ");
pass=sc.nextLine();
System.out.println("\nEnter Domain ID: ");
domID=sc.nextLine();
System.out.println("Enter a date in dd/mm/yyyy format :");
String date = sc.next();
EmailId obj1=new EmailId(user,pass,domID);
if((obj.username).equals(obj1.username))
{
u=1;
if(obj.password.equals(obj1.password))
{
up=1;
}
else
{
p=0;
}
}
else
{
u=0;
}
if(dateValidation(date)==true)
d=1;
else
d=0;
if(d==1)
{
if(u==0)
{
try{
throw new InvalidUsernameException(user);
}
catch (Exception e) {
System.out.println(e) ;
}
}
if (p==0){
{
try{
throw new InvalidPasswordException(pass);
}
catch (Exception e) {
System.out.println(e) ;
}
}
}
if(up==1)
{
System.out.println("Valid email id");
}
}
else{
System.out.println("Not a Valid email id");
}
}
public static boolean dateValidation(String date)
{
boolean status = false;
if (checkDate(date)) {
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
dateFormat.setLenient(false);
try {
dateFormat.parse(date);
status = true;
} catch (Exception e) {
status = false;
}
}
return status;
}
static boolean checkDate(String date) {
String pattern = "(0?[1-9]|[12][0-9]|3[01])\\/(0?[1-9]|1[0-2])\\/([0-9]{4})";
boolean flag = false;
if (date.matches(pattern)) {
flag = true;
}
return flag;
}
}
class InvalidUsernameException extends Exception{
String num1;
InvalidUsernameException(String num2) {
num1=num2;
}
public String toString(){
return ("exception in thread ‘main’ InvalidUsernameException: Username: "+ num1 + " doesn’t match") ;
}
}
class InvalidPasswordException extends Exception{
String num1;
InvalidPasswordException(String num2) {
num1=num2;
}
public String toString(){
return ("exception in thread ‘main’ InvalidPasswordException: Username: "+ num1 + " doesn’t match") ;
}
}
Get Internshala final test answers for all courses on SIKSHAPATH-STORE Like: Data science final test answer ( Link : DATA_SCIENCE ) Blockchain final test answer Internshala blockchain final test answer Matlab final test answer Ethical hacking final test answer Android app development final test answRead more
Get Internshala final test answers for all courses on SIKSHAPATH-STORE
Like:
Data science final test answer ( Link : DATA_SCIENCE )
Blockchain final test answer
Internshala blockchain final test answer
Matlab final test answer
Ethical hacking final test answer
Android app development final test answer Internshala
Shoprite is a grocery shop that has outlets nationwide. They give discounts to customers …
Download the Flowchart From the Below Attachment Link:
Download the Flowchart From the Below Attachment Link:
the average income of a person is rs210 and rs10 as a standard deviarion in a sample 100 people
Click on the below attachment button to download your answer
Click on the below attachment button to download your answer
See lessEmployee Management System
Click Below link to download the file :
Click Below link to download the file :
See lessWrite a program to enter length in centimeter and convert it into meter and kilometer, and also convert the same into Equivalents
Solution In C++ #include <iostream> using namespace std; int main(){ // declaraing the variables to take input // and to store the values in "m" and "km" double length_cm; double length_m; double length_km; cout<<"Convert centimeter into meter and kilometer : \n"; cout<<"---Read more
Solution In C++
Define class EmailId with members, username, domainId and password. Define default and parameterized constructors. Accept values from the command line and create a date object. Throw user defined exceptions – “InvalidUsernameException” or “InvalidPasswordException” if the uaername and password are invalid. If the date is valid, display message “Valid Email Id”.
Use Offline IDE like Sublime, VScode , IntelliJ to run this code. package sikshapath; //create your own package import java.util.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Scanner; class EmailId { String domainID,username,password; EmailId() { domainIDRead more
Use Offline IDE like Sublime, VScode , IntelliJ to run this code.
Data Science Internshala final test answer
Get Internshala final test answers for all courses on SIKSHAPATH-STORE Like: Data science final test answer ( Link : DATA_SCIENCE ) Blockchain final test answer Internshala blockchain final test answer Matlab final test answer Ethical hacking final test answer Android app development final test answRead more
Get Internshala final test answers for all courses on SIKSHAPATH-STORE
Like:
Data science final test answer ( Link : DATA_SCIENCE )
Blockchain final test answer
Internshala blockchain final test answer
Matlab final test answer
Ethical hacking final test answer
Android app development final test answer Internshala
Web development final test answer
Cloud computing using AWS final test answer
and many more.
Just visit: https://store.sikshapath.in/store/ or CLICK HERE -> Sikshapath-Store
See less